summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2018-05-02 21:16:57 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2018-05-02 22:43:19 +0300
commitd7760d638b140d53c6390a2fbee9b06460b43e9e (patch)
treef269e6fc2b544ad0e181211663f35811f2e4c2a6
parente76b6312391bdd62e31dc86cb65e478b07b7909e (diff)
downloadlinux-d7760d638b140d53c6390a2fbee9b06460b43e9e.tar.xz
iov_iter: fix memory leak in pipe_get_pages_alloc()
Make n signed to avoid leaking the pages array if __pipe_get_pages() fails to allocate any pages. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--lib/iov_iter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 4d5bf40d399d..fdae394172fa 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1102,7 +1102,7 @@ static ssize_t pipe_get_pages_alloc(struct iov_iter *i,
size_t *start)
{
struct page **p;
- size_t n;
+ ssize_t n;
int idx;
int npages;