This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: lgdt3306a: Fix a double kfree on i2c device remove
Author:  Brad Love <b...@nextdimension.cc>
Date:    Fri Jan 5 09:57:13 2018 -0500

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: Brad Love <b...@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mche...@s-opensource.com>

 drivers/media/dvb-frontends/lgdt3306a.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/dvb-frontends/lgdt3306a.c 
b/drivers/media/dvb-frontends/lgdt3306a.c
index adcaf9b20ce3..0ed64604d7af 100644
--- a/drivers/media/dvb-frontends/lgdt3306a.c
+++ b/drivers/media/dvb-frontends/lgdt3306a.c
@@ -1814,7 +1814,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;

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to