Blob Blame History Raw
From: Ilya Dryomov <idryomov@gmail.com>
Date: Wed, 2 May 2018 20:16:57 +0200
Subject: iov_iter: fix memory leak in pipe_get_pages_alloc()
Git-commit: d7760d638b140d53c6390a2fbee9b06460b43e9e
Patch-mainline: v4.17-rc7
References: bsc#1092710

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>
Acked-by: Luis Henriques <lhenriques@suse.com>
---
 lib/iov_iter.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1060,7 +1060,7 @@ static ssize_t pipe_get_pages_alloc(stru
 		   size_t *start)
 {
 	struct page **p;
-	size_t n;
+	ssize_t n;
 	int idx;
 	int npages;