aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-09-21 22:36:27 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-27 14:17:24 -0400
commitef40c0088ecbc8863c9404c96065269c83c16259 (patch)
tree27509088f79ca176e56addcc81197e064fb9d986
parent2a858486e0406110541e13f07d00665ee0c08a54 (diff)
[media] fc2580: 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/fc2580.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c
index 7db32ec4bd09..ec7965d7c2f8 100644
--- a/drivers/media/tuners/fc2580.c
+++ b/drivers/media/tuners/fc2580.c
@@ -487,9 +487,6 @@ struct dvb_frontend *fc2580_attach(struct dvb_frontend *fe,
487 487
488 priv->cfg = cfg; 488 priv->cfg = cfg;
489 priv->i2c = i2c; 489 priv->i2c = i2c;
490 fe->tuner_priv = priv;
491 memcpy(&fe->ops.tuner_ops, &fc2580_tuner_ops,
492 sizeof(struct dvb_tuner_ops));
493 490
494 /* check if the tuner is there */ 491 /* check if the tuner is there */
495 ret = fc2580_rd_reg(priv, 0x01, &chip_id); 492 ret = fc2580_rd_reg(priv, 0x01, &chip_id);
@@ -510,6 +507,10 @@ struct dvb_frontend *fc2580_attach(struct dvb_frontend *fe,
510 "%s: FCI FC2580 successfully identified\n", 507 "%s: FCI FC2580 successfully identified\n",
511 KBUILD_MODNAME); 508 KBUILD_MODNAME);
512 509
510 fe->tuner_priv = priv;
511 memcpy(&fe->ops.tuner_ops, &fc2580_tuner_ops,
512 sizeof(struct dvb_tuner_ops));
513
513 if (fe->ops.i2c_gate_ctrl) 514 if (fe->ops.i2c_gate_ctrl)
514 fe->ops.i2c_gate_ctrl(fe, 0); 515 fe->ops.i2c_gate_ctrl(fe, 0);
515 516