[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 f2fbb7c1598e0be09ef43a630f87a2eeeea757de..6f52d649e97e083b8fcd18a837526aeb5abacfec 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 bb0abdc78f37933957149eb433ec9e262a1b24a7..888f10a5e96b28bc469c9d14c4b265b89a527dc0 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));