提交 94448e21 编写于 作者: B Brad Love 提交者: Mauro Carvalho Chehab

media: lgdt3306a: Fix a double kfree on i2c device remove

Both lgdt33606a_release and lgdt3306a_remove kfree state, but _release is
called first, then _remove operates on states members before kfree'ing it.
This can lead to random oops/GPF/etc on USB disconnect.
Signed-off-by: NBrad Love <brad@nextdimension.cc>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 835d6617
...@@ -1814,7 +1814,13 @@ static void lgdt3306a_release(struct dvb_frontend *fe) ...@@ -1814,7 +1814,13 @@ static void lgdt3306a_release(struct dvb_frontend *fe)
struct lgdt3306a_state *state = fe->demodulator_priv; struct lgdt3306a_state *state = fe->demodulator_priv;
dbg_info("\n"); dbg_info("\n");
kfree(state);
/*
* If state->muxc is not NULL, then we are an i2c device
* and lgdt3306a_remove will clean up state
*/
if (!state->muxc)
kfree(state);
} }
static const struct dvb_frontend_ops lgdt3306a_ops; static const struct dvb_frontend_ops lgdt3306a_ops;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册