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>
Sat, 20 Jun 2020 08:24:15 +0000 (10:24 +0200)
commitcef66945b620e7e96c71d075c0cc58b2dd30d277
treec3251a9155f7b751db61fb94acb74378b327f861
parentc76a7a4af64cd64936898d5b90af58f8f82e0221
media: dvb: return -EREMOTEIO on i2c transfer failure.

[ 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