Commit ef40c008 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[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: default avatarOliver Schinagl <oliver@schinagl.nl>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2a858486
...@@ -487,9 +487,6 @@ struct dvb_frontend *fc2580_attach(struct dvb_frontend *fe, ...@@ -487,9 +487,6 @@ struct dvb_frontend *fc2580_attach(struct dvb_frontend *fe,
priv->cfg = cfg; priv->cfg = cfg;
priv->i2c = i2c; priv->i2c = i2c;
fe->tuner_priv = priv;
memcpy(&fe->ops.tuner_ops, &fc2580_tuner_ops,
sizeof(struct dvb_tuner_ops));
/* check if the tuner is there */ /* check if the tuner is there */
ret = fc2580_rd_reg(priv, 0x01, &chip_id); ret = fc2580_rd_reg(priv, 0x01, &chip_id);
...@@ -510,6 +507,10 @@ struct dvb_frontend *fc2580_attach(struct dvb_frontend *fe, ...@@ -510,6 +507,10 @@ struct dvb_frontend *fc2580_attach(struct dvb_frontend *fe,
"%s: FCI FC2580 successfully identified\n", "%s: FCI FC2580 successfully identified\n",
KBUILD_MODNAME); KBUILD_MODNAME);
fe->tuner_priv = priv;
memcpy(&fe->ops.tuner_ops, &fc2580_tuner_ops,
sizeof(struct dvb_tuner_ops));
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0); fe->ops.i2c_gate_ctrl(fe, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment