public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bttv: Fix memory leak in radio_release
@ 2008-04-10  9:40 Robert Fitzsimons
  0 siblings, 0 replies; only message in thread
From: Robert Fitzsimons @ 2008-04-10  9:40 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: video4linux-list, linux-kernel

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>
---
 drivers/media/video/bt8xx/bttv-driver.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


Seeing as commit 'V4L/DVB (7277): bttv: Re-enabling radio support
requires the use of struct bttv_fh' made it into mainline I better fix
the memory leak I introduced.

Robert


diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index fcf8f2d..59a8847 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3457,6 +3457,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);
-- 
1.5.4.3.484.g60e3

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-10  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-10  9:40 [PATCH] bttv: Fix memory leak in radio_release Robert Fitzsimons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox