aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tuner-core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 0e71a22f1d4..acbffbfdb50 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -180,8 +180,10 @@ static void set_type(struct i2c_client *c, unsigned int type,
180 /* discard private data, in case set_type() was previously called */ 180 /* discard private data, in case set_type() was previously called */
181 if (t->release) 181 if (t->release)
182 t->release(c); 182 t->release(c);
183 kfree(t->priv); 183 else {
184 t->priv = NULL; 184 kfree(t->priv);
185 t->priv = NULL;
186 }
185 187
186 switch (t->type) { 188 switch (t->type) {
187 case TUNER_MT2032: 189 case TUNER_MT2032:
@@ -566,7 +568,9 @@ static int tuner_detach(struct i2c_client *client)
566 568
567 if (t->release) 569 if (t->release)
568 t->release(client); 570 t->release(client);
569 kfree(t->priv); 571 else {
572 kfree(t->priv);
573 }
570 kfree(t); 574 kfree(t);
571 return 0; 575 return 0;
572} 576}