media: vivid: fix wrong pixel_array control size
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 6 Jul 2025 10:55:40 +0000 (12:55 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 8 Jul 2025 07:02:38 +0000 (09:02 +0200)
commit3e43442d4994c9e1e202c98129a87e330f7faaed
treee1cce86f6133bdb8f1da776fabd0565c0ca5312f
parent1610f15cba05e27ed74d42138b9bec45a315ead7
media: vivid: fix wrong pixel_array control size

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>
drivers/media/test-drivers/vivid/vivid-ctrls.c
drivers/media/test-drivers/vivid/vivid-vid-cap.c