]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:02 +0000 (10:17 +0100)
commitb693d48a6ed0cd09171103ad418e4a693203d6e4
tree96352a323ef68ae55e5348660ae28254fc1ec327
parent8fb48de871a5feee1b68130eedcd304be44b103e
media: adv7842: Avoid possible out-of-bounds array accesses in adv7842_cp_log_status()

commit 8163419e3e05d71dcfa8fb49c8fdf8d76908fe51 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/i2c/adv7842.c