public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Free the memory allocated by memdup_user() in fs/sysfs/bin.c
@ 2009-07-08 10:17 Catalin Marinas
  2009-07-12 14:57 ` Eric W. Biederman
  0 siblings, 1 reply; 2+ messages in thread
From: Catalin Marinas @ 2009-07-08 10:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, Parag Warudkar, linux-kernel

Commit 1c8542c7bb replaced kmalloc() with memdup_user() in the write()
function but also dropped the kfree(temp). The memdup_user() function
allocates memory which is never freed.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Parag Warudkar <parag.warudkar@gmail.com>
---
 fs/sysfs/bin.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 9345806..2524714 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -171,6 +171,7 @@ static ssize_t write(struct file *file, const char __user *userbuf,
 	if (count > 0)
 		*off = offs + count;
 
+	kfree(temp);
 	return count;
 }
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-12 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-08 10:17 [PATCH] Free the memory allocated by memdup_user() in fs/sysfs/bin.c Catalin Marinas
2009-07-12 14:57 ` Eric W. Biederman

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