From: Shuah Khan <shuah.kh@samsung.com>
To: m.chehab@samsung.com, dheitmueller@kernellabs.com, olebowle@gmx.com
Cc: Shuah Khan <shuah.kh@samsung.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] media: drx39xyj driver change to check fe exit flag from release
Date: Sat, 12 Jul 2014 10:44:14 -0600 [thread overview]
Message-ID: <079a2ff6ea88b8918b6144c8c054c6d4bb044347.1405179280.git.shuah.kh@samsung.com> (raw)
In-Reply-To: <cover.1405179280.git.shuah.kh@samsung.com>
In-Reply-To: <cover.1405179280.git.shuah.kh@samsung.com>
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>
---
drivers/media/dvb-frontends/drx39xyj/drxj.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
index 9482954..54855a9 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
@@ -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);
--
1.7.10.4
prev parent reply other threads:[~2014-07-12 16:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-12 16:44 [PATCH 0/3] media: prevent driver device access in disconnect path Shuah Khan
2014-07-12 16:44 ` [PATCH 1/3] media: dvb-core move fe exit flag from fepriv to fe for driver access Shuah Khan
2014-07-12 16:44 ` [PATCH 2/3] media: em28xx-dvb update fe exit flag to indicate device disconnect Shuah Khan
2014-07-12 16:44 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=079a2ff6ea88b8918b6144c8c054c6d4bb044347.1405179280.git.shuah.kh@samsung.com \
--to=shuah.kh@samsung.com \
--cc=dheitmueller@kernellabs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=olebowle@gmx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).