summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorAlaa Emad <alaaemadhossney.ae@gmail.com>2021-05-03 13:57:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-13 18:32:41 +0200
commitc6d822c56e7fd29e6fa1b1bb91b98f6a1e942b3c (patch)
treeb1657e71b77e54ff82b525674c3dbb45ac942210 /drivers/media/dvb-frontends
parent47e4ff06fa7f5ba4860543a2913bbd0c164640aa (diff)
media: dvb: Add check on sp8870_readreg return
The function sp8870_readreg returns a negative value when i2c_transfer fails so properly check for this and return the error if it happens. Cc: Sean Young <sean@mess.org> Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com> Link: https://lore.kernel.org/r/20210503115736.2104747-60-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/sp8870.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/sp8870.c b/drivers/media/dvb-frontends/sp8870.c
index ee893a2f2261..9767159aeb9b 100644
--- a/drivers/media/dvb-frontends/sp8870.c
+++ b/drivers/media/dvb-frontends/sp8870.c
@@ -280,7 +280,9 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
sp8870_writereg(state, 0xc05, reg0xc05);
// read status reg in order to clear pending irqs
- sp8870_readreg(state, 0x200);
+ err = sp8870_readreg(state, 0x200);
+ if (err < 0)
+ return err;
// system controller start
sp8870_microcontroller_start(state);