summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-11-02 00:05:54 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-11 21:14:44 +0300
commitad7b57d58d16666f607914bf9ff6950e1c5532a4 (patch)
treeeee3d05d1299fd242dafc7ea2827965f4e80846e /drivers
parentf161544d9d7d8e617c13fe30504317c417ed49e9 (diff)
downloadlinux-ad7b57d58d16666f607914bf9ff6950e1c5532a4.tar.xz
media: mxl111sf: improve error handling logic
As reported by smatch: drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c:485 mxl111sf_demod_read_signal_strength() error: uninitialized symbol 'modulation'. The mxl111sf_demod_read_signal_strength() just ignores if something gets wrong while reading snr or modulation. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
index f0ed37da73d4..221cf46b4140 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
@@ -477,10 +477,15 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
{
struct mxl111sf_demod_state *state = fe->demodulator_priv;
enum fe_modulation modulation;
+ int ret;
u16 snr;
- mxl111sf_demod_calc_snr(state, &snr);
- mxl1x1sf_demod_get_tps_modulation(state, &modulation);
+ ret = mxl111sf_demod_calc_snr(state, &snr);
+ if (ret < 0)
+ return ret;
+ ret = mxl1x1sf_demod_get_tps_modulation(state, &modulation);
+ if (ret < 0)
+ return ret;
switch (modulation) {
case QPSK: