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>
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)) {
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);