* [PATCH] drm/rockchip: check yuv2yuv existence before assigning window data
@ 2019-01-26 0:24 Heiko Stuebner
2019-01-26 14:52 ` Ezequiel Garcia
2019-01-27 20:43 ` Heiko Stuebner
0 siblings, 2 replies; 3+ messages in thread
From: Heiko Stuebner @ 2019-01-26 0:24 UTC (permalink / raw)
To: dri-devel; +Cc: ezequiel, linux-rockchip, dcastagna
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@sntech.de>
---
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 619b6db05d58..1dc9fd1ffbe3 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -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];
}
}
--
2.19.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/rockchip: check yuv2yuv existence before assigning window data
2019-01-26 0:24 [PATCH] drm/rockchip: check yuv2yuv existence before assigning window data Heiko Stuebner
@ 2019-01-26 14:52 ` Ezequiel Garcia
2019-01-27 20:43 ` Heiko Stuebner
1 sibling, 0 replies; 3+ messages in thread
From: Ezequiel Garcia @ 2019-01-26 14:52 UTC (permalink / raw)
To: Heiko Stuebner, dri-devel; +Cc: linux-rockchip, dcastagna
On Sat, 2019-01-26 at 01:24 +0100, Heiko Stuebner wrote:
> 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@sntech.de>
> ---
> drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 619b6db05d58..1dc9fd1ffbe3 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -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];
> }
> }
>
Ugh, another one of these.
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Thanks,
Eze
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/rockchip: check yuv2yuv existence before assigning window data
2019-01-26 0:24 [PATCH] drm/rockchip: check yuv2yuv existence before assigning window data Heiko Stuebner
2019-01-26 14:52 ` Ezequiel Garcia
@ 2019-01-27 20:43 ` Heiko Stuebner
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stuebner @ 2019-01-27 20:43 UTC (permalink / raw)
To: dri-devel; +Cc: ezequiel, linux-rockchip, dcastagna
Am Samstag, 26. Januar 2019, 01:24:37 CET schrieb Heiko Stuebner:
> 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@sntech.de>
applied to drm-misc-next where the fixed commit also waits for the
next merge-window.
Heiko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-27 20:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-26 0:24 [PATCH] drm/rockchip: check yuv2yuv existence before assigning window data Heiko Stuebner
2019-01-26 14:52 ` Ezequiel Garcia
2019-01-27 20:43 ` Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).