Skip to content

Commit

Permalink
V4L/DVB (7922): tuner-simple: fix tuner_warn() induced kernel oops in…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Jun 5, 2008
1 parent 5cf3f5c commit 3b4a971
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/common/tuners/tuner-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,10 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
fe->ops.i2c_gate_ctrl(fe, 1);

if (1 != i2c_transfer(i2c_adap, &msg, 1))
tuner_warn("unable to probe %s, proceeding anyway.",
tuners[type].name);
printk(KERN_WARNING "tuner-simple %d-%04x: "
"unable to probe %s, proceeding anyway.",
i2c_adapter_id(i2c_adap), i2c_addr,
tuners[type].name);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
Expand Down

0 comments on commit 3b4a971

Please sign in to comment.