summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAleksandr Burakov <a.burakov@rosalinux.ru>2024-02-16 15:40:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-03 09:59:55 +0300
commit97a80ca3dce374056fbc6578bf41ea22fc0e70e4 (patch)
tree30b0eb04a14d3b0f1bbcdff4f3f15ac9f3afdefd /drivers/media
parent23f5e185134cf4c2c50320b72a622bb576c0a67c (diff)
downloadlinux-97a80ca3dce374056fbc6578bf41ea22fc0e70e4.tar.xz
saa7134: Unchecked i2c_transfer function result fixed
[ Upstream commit 9d8683b3fd93f0e378f24dc3d9604e5d7d3e0a17 ] Return value of function 'i2c_transfer' is not checked that may cause undefined behaviour. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2cf36ac44730 ("[PATCH] v4l: 656: added support for the following cards") Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/pci/saa7134/saa7134-dvb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c
index 9c6cfef03331..a66df6adfaad 100644
--- a/drivers/media/pci/saa7134/saa7134-dvb.c
+++ b/drivers/media/pci/saa7134/saa7134-dvb.c
@@ -466,7 +466,9 @@ static int philips_europa_tuner_sleep(struct dvb_frontend *fe)
/* switch the board to analog mode */
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- i2c_transfer(&dev->i2c_adap, &analog_msg, 1);
+ if (i2c_transfer(&dev->i2c_adap, &analog_msg, 1) != 1)
+ return -EIO;
+
return 0;
}
@@ -1018,7 +1020,9 @@ static int md8800_set_voltage2(struct dvb_frontend *fe,
else
wbuf[1] = rbuf & 0xef;
msg[0].len = 2;
- i2c_transfer(&dev->i2c_adap, msg, 1);
+ if (i2c_transfer(&dev->i2c_adap, msg, 1) != 1)
+ return -EIO;
+
return 0;
}