Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e76bea9a authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[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: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 55d066a4
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -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