summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/lgdt3306a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb-frontends/lgdt3306a.c')
-rw-r--r--drivers/media/dvb-frontends/lgdt3306a.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c
index b964ea6020c9..fbb3b2f49d2d 100644
--- a/drivers/media/dvb-frontends/lgdt3306a.c
+++ b/drivers/media/dvb-frontends/lgdt3306a.c
@@ -1767,7 +1767,13 @@ static void lgdt3306a_release(struct dvb_frontend *fe)
struct lgdt3306a_state *state = fe->demodulator_priv;
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;