From: Sean Paul <[email protected]>

drm_atomic_get_crtc_state() returns an error pointer when it fails, so
the null check is doing nothing here.

Credit to 0-day/Dan Carpenter for reporting this.

Fixes: 6f3b62781bbd ("drm: Convert connector_helper_funcs->atomic_check to 
accept drm_atomic_state")
Cc: Daniel Vetter <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Ben Skeggs <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: Laurent Pinchart <[email protected]> [for rcar lvds]
Cc: Sean Paul <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Lyude Paul <[email protected]>
Cc: Karol Herbst <[email protected]>
Cc: Ilia Mirkin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reported-by: kbuild test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c 
b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index f2a5d4d997073..1c62578590f46 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -115,8 +115,8 @@ static int rcar_lvds_connector_atomic_check(struct 
drm_connector *connector,
 
        /* We're not allowed to modify the resolution. */
        crtc_state = drm_atomic_get_crtc_state(state, conn_state->crtc);
-       if (!crtc_state)
-               return -EINVAL;
+       if (IS_ERR(crtc_state))
+               return PTR_ERR(crtc_state);
 
        if (crtc_state->mode.hdisplay != panel_mode->hdisplay ||
            crtc_state->mode.vdisplay != panel_mode->vdisplay)
-- 
Sean Paul, Software Engineer, Google / Chromium OS

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to