[PATCH 2/2] iov_iter: fix memory leak in pipe_get_pages_alloc()
From: Ilya Dryomov
Date: Wed May 02 2018 - 14:17:42 EST
Make n signed to avoid leaking the pages array if __pipe_get_pages()
fails.
Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx>
---
lib/iov_iter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.4.3