From: Johannes Stezenbach Date: Tue, 17 May 2005 04:54:32 +0000 (-0700) Subject: [PATCH] dvb: dib3000: add NULL pointer check X-Git-Tag: v2.6.12-rc5~83 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1471c4f67321c09359d6fa8eb5c72c2463db081;p=linux-2.6 [PATCH] dvb: dib3000: add NULL pointer check prevent NULL pointer related Oopses (Patrick Boettcher) Signed-off-by: Johannes Stezenbach Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c index f2fbb7c159..6f52d649e9 100644 --- a/drivers/media/dvb/frontends/dib3000mb.c +++ b/drivers/media/dvb/frontends/dib3000mb.c @@ -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)); diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c index bb0abdc78f..888f10a5e9 100644 --- a/drivers/media/dvb/frontends/dib3000mc.c +++ b/drivers/media/dvb/frontends/dib3000mc.c @@ -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));