summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/bin.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-07-08 11:17:34 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-07-08 09:34:07 -0700
commitd5ce5b40bc66880d1732461d4b47d7fc3331ed30 (patch)
tree981ce8897febe8c0691247a5312f14c381359853 /fs/sysfs/bin.c
parent5e75c5f5d723074b1ceefe916c3005888e431d12 (diff)
downloadlinux-d5ce5b40bc66880d1732461d4b47d7fc3331ed30.tar.bz2
Free the memory allocated by memdup_user() in fs/sysfs/bin.c
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/sysfs/bin.c')
-rw-r--r--fs/sysfs/bin.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 9345806c8853..2524714bece1 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;
}