summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLothar Waßmann <LW@KARO-electronics.de>2016-07-12 15:30:01 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-07-12 18:26:06 +0200
commit76ecd9c9fb24b014a6f33fbb1287ede3be12158b (patch)
treedaa8f92a7ebaf951a6a0c1953bf21eb6a17b9342
parentb575b31387f64f63019c88a0ddbf1e0cc0cd8cd9 (diff)
downloadblackbird-op-linux-76ecd9c9fb24b014a6f33fbb1287ede3be12158b.tar.gz
blackbird-op-linux-76ecd9c9fb24b014a6f33fbb1287ede3be12158b.zip
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: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--drivers/gpu/drm/imx/parallel-display.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index 7b7bb3100831..4abac21c5c9b 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -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);
OpenPOWER on IntegriCloud