diff options
author | Giulio Benetti <giulio.benetti@micronovasrl.com> | 2018-10-05 23:59:50 +0200 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2018-11-06 16:55:24 +0100 |
commit | 7f4cedd882f7cae83177066c2b239ef457ce4a42 (patch) | |
tree | 016de1a53bbe2bc25c70ce834533089fac2db49f /drivers/gpu/drm/sun4i/sun4i_lvds.c | |
parent | Linux 4.20-rc1 (diff) | |
download | linux-dev-7f4cedd882f7cae83177066c2b239ef457ce4a42.tar.xz linux-dev-7f4cedd882f7cae83177066c2b239ef457ce4a42.zip |
drm/sun4i: tcon: fix check of tcon->panel null pointer
Since tcon->panel is a pointer returned by of_drm_find_panel() need to
check if it is not NULL, hence a valid pointer.
IS_ERR() instead checks return error values, not NULL pointers.
Substitute "if (!IS_ERR(tcon->panel))" with "if (tcon->panel)".
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181005215951.99003-1-giulio.benetti@micronovasrl.com
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_lvds.c')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_lvds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c b/drivers/gpu/drm/sun4i/sun4i_lvds.c index af7dcb6da351..e7eb0d1e17be 100644 --- a/drivers/gpu/drm/sun4i/sun4i_lvds.c +++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c @@ -75,7 +75,7 @@ static void sun4i_lvds_encoder_enable(struct drm_encoder *encoder) DRM_DEBUG_DRIVER("Enabling LVDS output\n"); - if (!IS_ERR(tcon->panel)) { + if (tcon->panel) { drm_panel_prepare(tcon->panel); drm_panel_enable(tcon->panel); } @@ -88,7 +88,7 @@ static void sun4i_lvds_encoder_disable(struct drm_encoder *encoder) DRM_DEBUG_DRIVER("Disabling LVDS output\n"); - if (!IS_ERR(tcon->panel)) { + if (tcon->panel) { drm_panel_disable(tcon->panel); drm_panel_unprepare(tcon->panel); } |