Skip to content

Commit 450677d

Browse files
edumazettorvalds
authored andcommitted
mm/madvise: fix memory leak from process_madvise
The early return in process_madvise() will produce a memory leak. Fix it. Fixes: ecb8ac8 ("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>
1 parent a349e4c commit 450677d

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

mm/madvise.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,6 @@ SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
12311231
ret = total_len - iov_iter_count(&iter);
12321232

12331233
mmput(mm);
1234-
return ret;
1235-
12361234
release_task:
12371235
put_task_struct(task);
12381236
put_pid:

0 commit comments

Comments
 (0)