[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1468330203-29150-2-git-send-email-LW@KARO-electronics.de>
Date: Tue, 12 Jul 2016 15:30:01 +0200
From: Lothar Waßmann <LW@...O-electronics.de>
To: David Airlie <airlied@...ux.ie>,
Philipp Zabel <p.zabel@...gutronix.de>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Daniel Vetter <daniel@...ll.ch>
Cc: Lothar Waßmann <LW@...O-electronics.de>
Subject: [PATCHv4 1/3] 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@...O-electronics.de>
---
drivers/gpu/drm/imx/parallel-display.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index 2d1fd02..4b2ec5d 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -69,10 +69,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);
--
2.1.4
Powered by blists - more mailing lists