Free the memory allocated by memdup_user() in fs/sysfs/bin.c
PATCH 1/1 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 <[email protected]>
Cc Parag Warudkar <[email protected]>
--- fs/sysfs/bin.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/sysfs/bin.c +1 -0
@@ -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; }
Quoted 3 lines · Catalin Marinas
Commit
1c8542c7bbreplacedkmalloc()withmemdup_user()in thewrite()function but also dropped the kfree(temp). Thememdup_user()function allocates memory which is never freed.
Quoted 24 lines
Signed-off-by Catalin Marinas <[email protected]>Cc Parag Warudkar <[email protected]>--- fs/sysfs/bin.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)fs/sysfs/bin.c +1
-1@@ -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; } --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/