Commit 76ecd9c9 authored by Lothar Waßmann's avatar Lothar Waßmann Committed by Philipp Zabel

drm/imx: parallel-display: check return code from of_get_drm_display_mode()

of_get_drm_display_mode() may fail. Check its return code and bail out
on error.
Signed-off-by: default avatarLothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent b575b313
......@@ -73,10 +73,16 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
int ret;
if (!mode)
return -EINVAL;
of_get_drm_display_mode(np, &imxpd->mode, OF_USE_NATIVE_MODE);
ret = of_get_drm_display_mode(np, &imxpd->mode,
OF_USE_NATIVE_MODE);
if (ret)
return ret;
drm_mode_copy(mode, &imxpd->mode);
mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
drm_mode_probed_add(connector, mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment