aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-20 06:11:57 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-30 22:16:45 -0400
commite04f4b2debc84ab801ee26f0e4c1c99e3ac2bd04 (patch)
tree3afd603bb6bb6567f4ab8e6fc209af55e83ecd67 /drivers/media
parentd1b4a085fbd31d182a19f8a0c5144e4f5e831b8a (diff)
[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 <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/dib8000.c4
1 files changed, 3 insertions, 1 deletions
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)
2680{ 2680{
2681 struct dib8000_state *state = fe->demodulator_priv; 2681 struct dib8000_state *state = fe->demodulator_priv;
2682 int ret = 0; 2682 int ret = 0;
2683 u16 lock, value, mode = fft_to_mode(state); 2683 u16 lock, value, mode;
2684 2684
2685 // we are already tuned - just resuming from suspend 2685 // we are already tuned - just resuming from suspend
2686 if (state == NULL) 2686 if (state == NULL)
2687 return -EINVAL; 2687 return -EINVAL;
2688 2688
2689 mode = fft_to_mode(state);
2690
2689 dib8000_set_bandwidth(fe, state->fe[0]->dtv_property_cache.bandwidth_hz / 1000); 2691 dib8000_set_bandwidth(fe, state->fe[0]->dtv_property_cache.bandwidth_hz / 1000);
2690 dib8000_set_channel(state, 0, 0); 2692 dib8000_set_channel(state, 0, 0);
2691 2693