diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-22 17:12:41 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-23 13:16:37 +0300 |
commit | e76bea9abd14a3a3af102fe30c5e9dd1b2e44d72 (patch) | |
tree | 3205dc1f59beb70626b3eee860d0476529999f9e /drivers/media/dvb-frontends | |
parent | 55d066a4c7b9e2e0c40eaac87a741f7217af6e8b (diff) | |
download | linux-e76bea9abd14a3a3af102fe30c5e9dd1b2e44d72.tar.xz |
[media] dib0090: do the right thing if rf_ramp is NULL
As warned by smatch:
drivers/media/dvb-frontends/dib0090.c:1118 dib0090_pwm_gain_reset() error: we previously assumed 'state->rf_ramp' could be null (see line 1086)
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/dib0090.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/dib0090.c b/drivers/media/dvb-frontends/dib0090.c index 976ee034a430..7ee784f1b771 100644 --- a/drivers/media/dvb-frontends/dib0090.c +++ b/drivers/media/dvb-frontends/dib0090.c @@ -1115,9 +1115,15 @@ void dib0090_pwm_gain_reset(struct dvb_frontend *fe) dib0090_set_bbramp_pwm(state, bb_ramp); /* activate the ramp generator using PWM control */ - dprintk("ramp RF gain = %d BAND = %s version = %d", state->rf_ramp[0], (state->current_band == BAND_CBAND) ? "CBAND" : "NOT CBAND", state->identity.version & 0x1f); - - if ((state->rf_ramp[0] == 0) || (state->current_band == BAND_CBAND && (state->identity.version & 0x1f) <= P1D_E_F)) { + if (rf_ramp) + dprintk("ramp RF gain = %d BAND = %s version = %d", + state->rf_ramp[0], + (state->current_band == BAND_CBAND) ? "CBAND" : "NOT CBAND", + state->identity.version & 0x1f); + + if (rf_ramp && ((state->rf_ramp[0] == 0) || + (state->current_band == BAND_CBAND && + (state->identity.version & 0x1f) <= P1D_E_F))) { dprintk("DE-Engage mux for direct gain reg control"); en_pwm_rf_mux = 0; } else |