From 7075ba7942b80704588cc60bce945519b0302ced Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 16 Jun 2016 11:12:13 +0200 Subject: [PATCH] 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 Signed-off-by: Philipp Zabel --- drivers/gpu/drm/imx/imx-ldb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 00d67b5407d8..5d2831dfb8b9 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -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); -- 2.20.1