提交 d5ce5b40 编写于 作者: C Catalin Marinas 提交者: Linus Torvalds

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: NCatalin Marinas <catalin.marinas@arm.com>
Cc: Parag Warudkar <parag.warudkar@gmail.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5e75c5f5
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册