Skip to content

Commit

Permalink
[media] media: drx39xyj driver change to check fe exit flag from release
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shuah Khan authored and Mauro Carvalho Chehab committed Jul 26, 2014
1 parent f68e35a commit 5b22b1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/dvb-frontends/drx39xyj/drxj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5b22b1a

Please sign in to comment.