]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: adv7604: prevent underflow condition when reporting colorspace
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 15 Oct 2024 10:25:09 +0000 (12:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Nov 2024 12:13:37 +0000 (13:13 +0100)
commit7db74a57cca3fbe8a62d8b85af79beee7a5b7f9e
treead3a908bf094103e7be04625cb0431fe5787dc0e
parent7191120224252fb573726c4a1b1cd6c5a617aa82
media: adv7604: prevent underflow condition when reporting colorspace

[ Upstream commit 50b9fa751d1aef5d262bde871c70a7f44262f0bc ]

Currently, adv76xx_log_status() reads some date using
io_read() which may return negative values. The current logic
doesn't check such errors, causing colorspace to be reported
on a wrong way at adv76xx_log_status(), as reported by Coverity.

If I/O error happens there, print a different message, instead
of reporting bogus messages to userspace.

Fixes: 54450f591c99 ("[media] adv7604: driver for the Analog Devices ADV7604 video decoder")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/adv7604.c