]> 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:14:44 +0000 (10:14 +0100)
commit60dde0960e3ead8a9569f6c494d90d0232ac0983
tree0b108f96c92762eb34415e7280c106dd930d2ebb
parentbfa153eae8da9ca295ae03696e9770c729276bd2
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