Commit d5ce5b40 authored by Catalin Marinas's avatar Catalin Marinas Committed by Linus Torvalds
Browse files

Free the memory allocated by memdup_user() in fs/sysfs/bin.c



Commit 1c8542c7 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: default avatarCatalin Marinas <catalin.marinas@arm.com>
Cc: Parag Warudkar <parag.warudkar@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5e75c5f5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
}