Patch "drm/rockchip: vop2: fix null pointer in plane_atomic_disable" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/rockchip: vop2: fix null pointer in plane_atomic_disable

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-rockchip-vop2-fix-null-pointer-in-plane_atomic_d.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 829f6385416ac91e44e9ac103642a13f7cd3cd60
Author: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
Date:   Fri Oct 28 11:52:05 2022 +0200

    drm/rockchip: vop2: fix null pointer in plane_atomic_disable
    
    [ Upstream commit 471bf2406c043491b1a8288e5f04bc278f7d7ca1 ]
    
    If the vop2_plane_atomic_disable function is called with NULL as a
    state, accessing the old_pstate runs into a null pointer exception.
    However, the drm_atomic_helper_disable_planes_on_crtc function calls the
    atomic_disable callback with state NULL.
    
    Allow to disable a plane without passing a plane state by checking the
    old_pstate only if a state is passed.
    
    Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
    Signed-off-by: Heiko Stuebner <heiko@xxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20221028095206.2136601-2-m.tretter@xxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index f9aa8b96c695..bf9c3e92e1cd 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -997,13 +997,15 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,
 static void vop2_plane_atomic_disable(struct drm_plane *plane,
 				      struct drm_atomic_state *state)
 {
-	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(state, plane);
+	struct drm_plane_state *old_pstate = NULL;
 	struct vop2_win *win = to_vop2_win(plane);
 	struct vop2 *vop2 = win->vop2;
 
 	drm_dbg(vop2->drm, "%s disable\n", win->data->name);
 
-	if (!old_pstate->crtc)
+	if (state)
+		old_pstate = drm_atomic_get_old_plane_state(state, plane);
+	if (old_pstate && !old_pstate->crtc)
 		return;
 
 	vop2_win_disable(win);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux