media: dvb: Add check on sp8870_readreg return
authorAlaa Emad <alaaemadhossney.ae@gmail.com>
Mon, 3 May 2021 11:57:26 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 06:36:21 +0000 (08:36 +0200)
commitf956f258578954102ee3ed86ce6ed58c9a2604db
tree62353e7f737b0a8902f88a2be39db12daf7ca751
parent731174d51e3a36fefc3886dac5acd441c0513707
media: dvb: Add check on sp8870_readreg return

[ Upstream commit c6d822c56e7fd29e6fa1b1bb91b98f6a1e942b3c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/dvb-frontends/sp8870.c