mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 01:09:38 -05:00
mm/madvise: fix memory leak from process_madvise
The early return in process_madvise() will produce a memory leak.
Fix it.
Fixes: ecb8ac8b1f
("mm/madvise: introduce process_madvise() syscall: an external memory hinting API")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20201116155132.GA3805951@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a349e4c659
commit
450677dcb0
1 changed files with 0 additions and 2 deletions
|
@ -1231,8 +1231,6 @@ SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
|
|||
ret = total_len - iov_iter_count(&iter);
|
||||
|
||||
mmput(mm);
|
||||
return ret;
|
||||
|
||||
release_task:
|
||||
put_task_struct(task);
|
||||
put_pid:
|
||||
|
|
Loading…
Add table
Reference in a new issue