drm/rockchip: check yuv2yuv existence before assigning window

A patch from »drm/rockchip: check yuv2yuv existence before assigning window« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Sat, 26 Jan 2019 01:15:26 +0100

Commit-Message

Before assigning window data, we should check if the yuv2yuv vop-data is set at all, because it looks like it can otherwise reference something wrong, as I saw on my rk3188 today which ended up in a null pointer dereference in vop_plane_atomic_update when accessing the yuv2yuv data. Fixes: 1c21aa8f2b68 ("drm/rockchip: Fix YUV buffers color rendering") Signed-off-by: Heiko Stuebner <heiko@...>

Patch-Comment

drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

Statistics

  • 3 lines added
  • 1 lines removed

Changes

----------------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c ------------------
index 619b6db05d58..1dc9fd1ffbe3 100644
@@ -1675,7 +1675,9 @@ static void vop_win_init(struct vop *vop)
vop_win->data = win_data;
vop_win->vop = vop;
- vop_win->yuv2yuv_data = &vop_data->win_yuv2yuv[i];
+
+ if (vop_data->win_yuv2yuv)
+ vop_win->yuv2yuv_data = &vop_data->win_yuv2yuv[i];
}
}
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...