]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: dvb: return -EREMOTEIO on i2c transfer failure.
authorColin Ian King <colin.king@canonical.com>
Mon, 10 Feb 2020 17:51:33 +0000 (18:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:30 +0000 (09:32 +0200)
[ Upstream commit 96f3a9392799dd0f6472648a7366622ffd0989f3 ]

Currently when i2c transfers fail the error return -EREMOTEIO
is assigned to err but then later overwritten when the tuner
attach call is made.  Fix this by returning early with the
error return code -EREMOTEIO on i2c transfer failure errors.

If the transfer fails, an uninitialized value will be read from b2.

Addresses-Coverity: ("Unused value")

Fixes: fbfee8684ff2 ("V4L/DVB (5651): Dibusb-mb: convert pll handling to properly use dvb-pll")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/usb/dvb-usb/dibusb-mb.c

index d4ea72bf09c5808c9f95c55c51d67836eb3c0a70..5131c8d4c632885ab6ade5f69d20cde1a33c4722 100644 (file)
@@ -81,7 +81,7 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_adapter *adap)
 
        if (i2c_transfer(&adap->dev->i2c_adap, msg, 2) != 2) {
                err("tuner i2c write failed.");
-               ret = -EREMOTEIO;
+               return -EREMOTEIO;
        }
 
        if (adap->fe_adap[0].fe->ops.i2c_gate_ctrl)