summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-11-22 12:40:25 -0500
committerMichael Krufky <mkrufky@linuxtv.org>2007-11-22 12:40:25 -0500
commit3cc68cf094c1c59eb7191345b490d17ef76c9a5a (patch)
treedcff6a64602bad66e1f26d7308567a004c668db4
parent1dc42bce5c6a929a75e3205bacc1da3dfebb4429 (diff)
downloadmediapointer-dvb-s2-3cc68cf094c1c59eb7191345b490d17ef76c9a5a.tar.gz
mediapointer-dvb-s2-3cc68cf094c1c59eb7191345b490d17ef76c9a5a.tar.bz2
tda827x: prevent possible NULL pointer dereference in tda827xa_lna_gain
From: Michael Krufky <mkrufky@linuxtv.org> If tda827x_config hasn't been defined, exit the function. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-rw-r--r--linux/drivers/media/dvb/frontends/tda827x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda827x.c b/linux/drivers/media/dvb/frontends/tda827x.c
index 8ec49718b..ed1502252 100644
--- a/linux/drivers/media/dvb/frontends/tda827x.c
+++ b/linux/drivers/media/dvb/frontends/tda827x.c
@@ -557,6 +557,11 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
.buf = buf, .len = sizeof(buf) };
+ if (NULL == priv->cfg) {
+ dprintk("tda827x_config not defined, cannot set LNA gain!\n");
+ return;
+ }
+
if (priv->cfg->config) {
if (high)
dprintk("setting LNA to high gain\n");