From: Dan Carpenter Date: Fri, 20 Jul 2012 10:11:57 +0000 (-0300) Subject: [media] dib8000: move dereference after check for NULL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e04f4b2debc84ab801ee26f0e4c1c99e3ac2bd04;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] dib8000: move dereference after check for NULL My static checker complains that we dereference "state" inside the call to fft_to_mode() before checking for NULL. The comments say that it is possible for "state" to be NULL so I have moved the dereference after the check. Signed-off-by: Dan Carpenter Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/dib8000.c b/drivers/media/dvb/frontends/dib8000.c index 9ca34f495009..1f3bcb5a1de8 100644 --- a/drivers/media/dvb/frontends/dib8000.c +++ b/drivers/media/dvb/frontends/dib8000.c @@ -2680,12 +2680,14 @@ static int dib8000_tune(struct dvb_frontend *fe) { struct dib8000_state *state = fe->demodulator_priv; int ret = 0; - u16 lock, value, mode = fft_to_mode(state); + u16 lock, value, mode; // we are already tuned - just resuming from suspend if (state == NULL) return -EINVAL; + mode = fft_to_mode(state); + dib8000_set_bandwidth(fe, state->fe[0]->dtv_property_cache.bandwidth_hz / 1000); dib8000_set_channel(state, 0, 0);