lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20080410094031.GA2532@localhost>
Date:	Thu, 10 Apr 2008 10:40:31 +0100
From:	Robert Fitzsimons <robfitz@...k.net>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>
Cc:	video4linux-list@...hat.com, linux-kernel@...r.kernel.org
Subject: [PATCH] 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@...k.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ