]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: rockchip: rkcif: fix off by one bugs
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 20 Feb 2026 08:15:07 +0000 (09:15 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:34 +0000 (01:05 +0100)
commite4056b84af0fc18c84b4e5741df04ecd8ca17973
tree44280f1de067bca7a41a7529557b54f5ba70f00e
parent937ffb7a427649a6bd7d1bd778cbcb70700e3062
media: rockchip: rkcif: fix off by one bugs

Change these comparisons from > vs >= to avoid accessing one element
beyond the end of the arrays.
While at it, use ARRAY_SIZE instead of the _MAX enum values.

Fixes: 1f2353f5a1af ("media: rockchip: rkcif: add support for rk3568 vicap mipi capture")
Cc: stable@kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Michael Riesch <michael.riesch@collabora.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Chen-Yu Tsai <wens@kernel.org>
[fix cosmetic issues]
Signed-off-by: Michael Riesch <michael.riesch@collabora.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c