diff options
author | Andy Walls <awalls@radix.net> | 2008-05-26 00:31:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-05 05:35:44 -0400 |
commit | 3b4a9714f43a1d675a4352260a12daae197f37c3 (patch) | |
tree | a095208ac75a02bf70ed33d4f4440ebaa354276e | |
parent | 5cf3f5cd1f6ee0d81b75c659c732dd8dd245a350 (diff) |
V4L/DVB (7922): tuner-simple: fix tuner_warn() induced kernel oops in simple_tuner_attach()
The tuner_warn() macro relies on the local variable "priv" to be a valid
pointer. There was a case in simple_tuner_attach() where this cannot be the
case yet, so tuner_warn() would dereference a NULL "priv" pointer. Changed
the tuner_warn() to a printk() with the originally intended output format.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/common/tuners/tuner-simple.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c index be8d903171b7..266c255cf0d8 100644 --- a/drivers/media/common/tuners/tuner-simple.c +++ b/drivers/media/common/tuners/tuner-simple.c | |||
@@ -1018,8 +1018,10 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, | |||
1018 | fe->ops.i2c_gate_ctrl(fe, 1); | 1018 | fe->ops.i2c_gate_ctrl(fe, 1); |
1019 | 1019 | ||
1020 | if (1 != i2c_transfer(i2c_adap, &msg, 1)) | 1020 | if (1 != i2c_transfer(i2c_adap, &msg, 1)) |
1021 | tuner_warn("unable to probe %s, proceeding anyway.", | 1021 | printk(KERN_WARNING "tuner-simple %d-%04x: " |
1022 | tuners[type].name); | 1022 | "unable to probe %s, proceeding anyway.", |
1023 | i2c_adapter_id(i2c_adap), i2c_addr, | ||
1024 | tuners[type].name); | ||
1023 | 1025 | ||
1024 | if (fe->ops.i2c_gate_ctrl) | 1026 | if (fe->ops.i2c_gate_ctrl) |
1025 | fe->ops.i2c_gate_ctrl(fe, 0); | 1027 | fe->ops.i2c_gate_ctrl(fe, 0); |