From: Ilya Dryomov Date: Wed, 2 May 2018 18:16:57 +0000 (+0200) Subject: iov_iter: fix memory leak in pipe_get_pages_alloc() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d7760d638b140d53c6390a2fbee9b06460b43e9e;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Al Viro --- 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;