]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: staging: media: zoran: calculate the right buffer number for zoran_reap_stat_com
authorCorentin Labbe <clabbe@baylibre.com>
Tue, 14 Dec 2021 16:16:32 +0000 (17:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:33 +0000 (14:40 +0200)
commitbafec1a6ba4b187a7fcdcfce0faebdc623d4ef8e
tree6b8fff56feddc6bd3f69276c57ecb5cac70ef5a5
parentbd01629315ffd5b63da91d0bd529a77d30e55028
media: staging: media: zoran: calculate the right buffer number for zoran_reap_stat_com

[ Upstream commit e3b86f4e558cea9eed71d894df2f19b10d60a207 ]

On the case tmp_dcim=1, the index of buffer is miscalculated.
This generate a NULL pointer dereference later.

So let's fix the calcul and add a check to prevent this to reappear.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/zoran/zoran_device.c