drm/imx: imx-ldb: check return code on panel attach

Check the return code on panel attach. Avoids a kernel crash later
on if the attach failed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Lucas Stach 2016-06-16 11:12:13 +02:00 committed by Philipp Zabel
parent 3df0739052
commit 7075ba7942
1 changed files with 6 additions and 2 deletions

View File

@ -474,8 +474,12 @@ static int imx_ldb_register(struct drm_device *drm,
drm_connector_init(drm, &imx_ldb_ch->connector,
&imx_ldb_connector_funcs, DRM_MODE_CONNECTOR_LVDS);
if (imx_ldb_ch->panel)
drm_panel_attach(imx_ldb_ch->panel, &imx_ldb_ch->connector);
if (imx_ldb_ch->panel) {
ret = drm_panel_attach(imx_ldb_ch->panel,
&imx_ldb_ch->connector);
if (ret)
return ret;
}
drm_mode_connector_attach_encoder(&imx_ldb_ch->connector, encoder);