]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: vivid: fix wrong pixel_array control size
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 6 Jul 2025 10:55:40 +0000 (12:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:31:00 +0000 (16:31 +0200)
commit5fd3269dfaaa903e7000983c00904c8c5628765a
treea809752082ec7677a09812565033f46057b8392b
parentc851e2c892346c72455ed3f2025a07f6ddb4dd6d
media: vivid: fix wrong pixel_array control size

commit 3e43442d4994c9e1e202c98129a87e330f7faaed upstream.

The pixel_array control size was calculated incorrectly:
the dimensions were swapped (dims[0] should be the height), and the
values should be the width or height divided by PIXEL_ARRAY_DIV
and rounded up. So don't use roundup, but use DIV_ROUND_UP instead.

This bug is harmless in the sense that nothing will break, except that
it consumes way too much memory for this control.

Fixes: 6bc7643d1b9c ("media: vivid: add pixel_array test control")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/test-drivers/vivid/vivid-ctrls.c
drivers/media/test-drivers/vivid/vivid-vid-cap.c