aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/madvise.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index 2efcde2d7e4c..df59937c75e3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1435,8 +1435,7 @@ SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
iov_iter_advance(&iter, iovec.iov_len);
}
- if (ret == 0)
- ret = total_len - iov_iter_count(&iter);
+ ret = (total_len - iov_iter_count(&iter)) ? : ret;
release_mm:
mmput(mm);