summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/drx39xyj
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-09 10:33:54 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 07:37:17 -0300
commit1e5ec31a462f6d02aba57dbdb9119478943fc2e8 (patch)
tree920e8870fa45cffe9f1586788027e691ec70735e /drivers/media/dvb-frontends/drx39xyj
parent01473146394f28735778aefaf9faae109d6ee5f2 (diff)
downloadblackbird-op-linux-1e5ec31a462f6d02aba57dbdb9119478943fc2e8.tar.gz
blackbird-op-linux-1e5ec31a462f6d02aba57dbdb9119478943fc2e8.zip
[media] drx-j: Fix usage of drxj_close()
This function is currently not used. However, it was meant to be called at device release. So, add it there. While here, remove the bad check, as reported by Dan, as smatch warning: drivers/media/dvb-frontends/drx39xyj/drxj.c:20041 drxj_close() warn: variable dereferenced before check 'demod' (see line 20036) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/drx39xyj')
-rw-r--r--drivers/media/dvb-frontends/drx39xyj/drxj.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
index 828d0527f38d..c5205d5c997e 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
@@ -11510,8 +11510,7 @@ static int drxj_close(struct drx_demod_instance *demod)
int rc;
enum drx_power_mode power_mode = DRX_POWER_UP;
- if ((demod == NULL) ||
- (demod->my_common_attr == NULL) ||
+ if ((demod->my_common_attr == NULL) ||
(demod->my_ext_attr == NULL) ||
(demod->my_i2c_dev_addr == NULL) ||
(!demod->my_common_attr->is_opened)) {
@@ -12218,6 +12217,8 @@ 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);
+
kfree(demod->my_ext_attr);
kfree(demod->my_common_attr);
kfree(demod->my_i2c_dev_addr);
OpenPOWER on IntegriCloud