kernel/drivers/gpu/drm/panel/panel-sitronix-st7701.c
.. .. @@ -384,7 +384,15 @@ 384 384 st7701->dsi = dsi; 385 385 st7701->desc = desc; 386 386 387 - return mipi_dsi_attach(dsi);387 + ret = mipi_dsi_attach(dsi);388 + if (ret)389 + goto err_attach;390 +391 + return 0;392 +393 +err_attach:394 + drm_panel_remove(&st7701->panel);395 + return ret;388 396 } 389 397 390 398 static int st7701_dsi_remove(struct mipi_dsi_device *dsi)