diff options
author | Antti Palosaari <crope@iki.fi> | 2012-09-22 11:32:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-27 14:17:44 -0400 |
commit | 36f647bad3d35546892c3639328479355da8690d (patch) | |
tree | 83686bc568439250376bd79998cb118ba3d9689c | |
parent | ef40c0088ecbc8863c9404c96065269c83c16259 (diff) |
[media] e4000: fix crash when attach fails
Callbacks were set even attach failed. This leads calling
.release() in error case and resulted crash.
Reported-by: Oliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/tuners/e4000.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c index ffaa4824d6af..1b33ed368abe 100644 --- a/drivers/media/tuners/e4000.c +++ b/drivers/media/tuners/e4000.c | |||
@@ -366,9 +366,6 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend *fe, | |||
366 | 366 | ||
367 | priv->cfg = cfg; | 367 | priv->cfg = cfg; |
368 | priv->i2c = i2c; | 368 | priv->i2c = i2c; |
369 | fe->tuner_priv = priv; | ||
370 | memcpy(&fe->ops.tuner_ops, &e4000_tuner_ops, | ||
371 | sizeof(struct dvb_tuner_ops)); | ||
372 | 369 | ||
373 | /* check if the tuner is there */ | 370 | /* check if the tuner is there */ |
374 | ret = e4000_rd_reg(priv, 0x02, &chip_id); | 371 | ret = e4000_rd_reg(priv, 0x02, &chip_id); |
@@ -389,6 +386,10 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend *fe, | |||
389 | "%s: Elonics E4000 successfully identified\n", | 386 | "%s: Elonics E4000 successfully identified\n", |
390 | KBUILD_MODNAME); | 387 | KBUILD_MODNAME); |
391 | 388 | ||
389 | fe->tuner_priv = priv; | ||
390 | memcpy(&fe->ops.tuner_ops, &e4000_tuner_ops, | ||
391 | sizeof(struct dvb_tuner_ops)); | ||
392 | |||
392 | if (fe->ops.i2c_gate_ctrl) | 393 | if (fe->ops.i2c_gate_ctrl) |
393 | fe->ops.i2c_gate_ctrl(fe, 0); | 394 | fe->ops.i2c_gate_ctrl(fe, 0); |
394 | 395 | ||