[DVB patch 17/37] dib3000: add NULL pointer check

From: Johannes Stezenbach
Date: Sun May 08 2005 - 14:27:12 EST


prevent NULL pointer related Oopses (Patrick Boettcher)

Signed-off-by: Johannes Stezenbach <js@xxxxxxxxxxx>
---

drivers/media/dvb/frontends/dib3000mb.c | 2 +-
drivers/media/dvb/frontends/dib3000mc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.12-rc4/drivers/media/dvb/frontends/dib3000mb.c
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/frontends/dib3000mb.c 2005-05-08 16:21:47.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/frontends/dib3000mb.c 2005-05-08 16:22:51.000000000 +0200
@@ -61,7 +61,7 @@ static int dib3000mb_set_frontend(struct
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: linux-2.6.12-rc4/drivers/media/dvb/frontends/dib3000mc.c
===================================================================
--- linux-2.6.12-rc4.orig/drivers/media/dvb/frontends/dib3000mc.c 2005-05-08 16:21:47.000000000 +0200
+++ linux-2.6.12-rc4/drivers/media/dvb/frontends/dib3000mc.c 2005-05-08 16:22:51.000000000 +0200
@@ -463,7 +463,7 @@ static int dib3000mc_set_frontend(struct
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));

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/