[media] media: drx39xyj driver change to check fe exit flag from release
authorShuah Khan <shuah.kh@samsung.com>
Sat, 12 Jul 2014 16:44:14 +0000 (13:44 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sat, 26 Jul 2014 14:19:21 +0000 (11:19 -0300)
Change drx39xyj_release() to check fe exit flag to detect the
device disconnect state and avoid accessing the device after
it has been removed.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/dvb-frontends/drx39xyj/drxj.c

index 3795f65564f87c4156b89c6eef50626a4479294b..7007e0b507c097737e38fef67c980ba5b511472b 100644 (file)
@@ -12238,7 +12238,9 @@ static void drx39xxj_release(struct dvb_frontend *fe)
        struct drx39xxj_state *state = fe->demodulator_priv;
        struct drx_demod_instance *demod = state->demod;
 
-       drxj_close(demod);
+       /* if device is removed don't access it */
+       if (fe->exit != DVB_FE_DEVICE_REMOVED)
+               drxj_close(demod);
 
        kfree(demod->my_ext_attr);
        kfree(demod->my_common_attr);