summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/tuner-core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index d2c946e2a..e00c59873 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -207,8 +207,10 @@ static void set_type(struct i2c_client *c, unsigned int type,
/* discard private data, in case set_type() was previously called */
if (t->release)
t->release(c);
- kfree(t->priv);
- t->priv = NULL;
+ else {
+ kfree(t->priv);
+ t->priv = NULL;
+ }
switch (t->type) {
case TUNER_MT2032:
@@ -623,10 +625,12 @@ MOD_DEC_USE_COUNT;
#endif
if (t->release)
t->release(client);
- kfree(t->priv);
+ else {
+ kfree(t->priv);
#if 0
- t->priv = NULL;
+ t->priv = NULL;
#endif
+ }
kfree(t);
return 0;
}