]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: adv7842: Avoid possible out-of-bounds array accesses in adv7842_cp_log_status()
authorIvan Abramov <i.abramov@mt-integration.ru>
Tue, 2 Sep 2025 23:23:31 +0000 (02:23 +0300)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 14 Oct 2025 13:07:37 +0000 (15:07 +0200)
commit8163419e3e05d71dcfa8fb49c8fdf8d76908fe51
tree04ade41dba0950379c7e50549ae3e5214bbc5a09
parent8f34f24355a607b98ecd9924837aab13c676eeca
media: adv7842: Avoid possible out-of-bounds array accesses in adv7842_cp_log_status()

It's possible for cp_read() and hdmi_read() to return -EIO. Those
values are further used as indexes for accessing arrays.

Fix that by checking return values where it's needed.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: a89bcd4c6c20 ("[media] adv7842: add new video decoder driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/adv7842.c