From: Robert Fitzsimons <robfitz@273k.net>
Date: Thu, 10 Apr 2008 12:40:31 +0000 (-0300)
Subject: V4L/DVB (7579): bttv: Fix memory leak in radio_release
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9bc07a006ae94d7b3dd5db873bcf10ceb749253;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

V4L/DVB (7579): bttv: Fix memory leak in radio_release

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>
---

diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 79da9d01d715..2ca3e9cfb2bb 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -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);