drm/omap: drm_atomic_get_plane_state() may return ERR_PTR
authorJyri Sarha <jsarha@ti.com>
Wed, 28 Oct 2015 12:00:42 +0000 (14:00 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 3 Mar 2016 15:36:41 +0000 (17:36 +0200)
drm_atomic_get_plane_state() may return ERR_PTR. Handle
drm_atomic_get_plane_state() return values right in
omap_crtc_atomic_set_property().

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/omapdrm/omap_crtc.c

index 7dd3d44a93e5b85c42ab31cdcb88808ce7bb1473..f5b19d18fa8b2cd18dd14a445d655618044c4b16 100644 (file)
@@ -433,8 +433,8 @@ static int omap_crtc_atomic_set_property(struct drm_crtc *crtc,
         */
 
        plane_state = drm_atomic_get_plane_state(state->state, plane);
-       if (!plane_state)
-               return -EINVAL;
+       if (IS_ERR(plane_state))
+               return PTR_ERR(plane_state);
 
        return drm_atomic_plane_set_property(plane, plane_state, property, val);
 }