V4L/DVB (7579): bttv: Fix memory leak in radio_release
authorRobert Fitzsimons <robfitz@273k.net>
Thu, 10 Apr 2008 12:40:31 +0000 (09:40 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:09:40 +0000 (14:09 -0300)
Fix the leak of the bttv_fh structure allocated in radio_open which
was introduced by commit 5cd3955cb8adfc1edf481e9e1cb2289db50ccacb.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/bt8xx/bttv-driver.c

index 79da9d01d715b81d6bf61a7ebb4f47f784468be1..2ca3e9cfb2bbbaf0887e70e23624268002e328f5 100644 (file)
@@ -3463,6 +3463,9 @@ static int radio_release(struct inode *inode, struct file *file)
        struct bttv *btv = fh->btv;
        struct rds_command cmd;
 
+       file->private_data = NULL;
+       kfree(fh);
+
        btv->radio_user--;
 
        bttv_call_i2c_clients(btv, RDS_CMD_CLOSE, &cmd);