提交 36f647ba 编写于 作者: A Antti Palosaari 提交者: Mauro Carvalho Chehab

[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: NOliver Schinagl <oliver@schinagl.nl>
Signed-off-by: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ef40c008
......@@ -366,9 +366,6 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
priv->cfg = cfg;
priv->i2c = i2c;
fe->tuner_priv = priv;
memcpy(&fe->ops.tuner_ops, &e4000_tuner_ops,
sizeof(struct dvb_tuner_ops));
/* check if the tuner is there */
ret = e4000_rd_reg(priv, 0x02, &chip_id);
......@@ -389,6 +386,10 @@ struct dvb_frontend *e4000_attach(struct dvb_frontend *fe,
"%s: Elonics E4000 successfully identified\n",
KBUILD_MODNAME);
fe->tuner_priv = priv;
memcpy(&fe->ops.tuner_ops, &e4000_tuner_ops,
sizeof(struct dvb_tuner_ops));
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册