[PATCH] dvb: dib3000: add NULL pointer check
authorJohannes Stezenbach <js@linuxtv.org>
Tue, 17 May 2005 04:54:32 +0000 (21:54 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 17 May 2005 14:59:30 +0000 (07:59 -0700)
prevent NULL pointer related Oopses (Patrick Boettcher)

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/dvb/frontends/dib3000mb.c
drivers/media/dvb/frontends/dib3000mc.c

index f2fbb7c..6f52d64 100644 (file)
@@ -61,7 +61,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
        fe_code_rate_t fe_cr = FEC_NONE;
        int search_state, seq;
 
-       if (tuner) {
+       if (tuner && state->config.pll_addr && state->config.pll_set) {
                dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
                state->config.pll_set(fe, fep, NULL);
                dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
index bb0abdc..888f10a 100644 (file)
@@ -463,7 +463,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
        int search_state,auto_val;
        u16 val;
 
-       if (tuner) { /* initial call from dvb */
+       if (tuner && state->config.pll_addr && state->config.pll_set) { /* initial call from dvb */
                dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
                state->config.pll_set(fe,fep,NULL);
                dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));