]> 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>
Mon, 19 Jan 2026 12:11:57 +0000 (13:11 +0100)
commitf81ee181cb036d046340c213091b69d9a8701a76
tree5a2434bc9b1ffbada8f8283108634678800b8ab8
parent5cd909587ac529f82d31e821ce8d19ce01e8927c
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