From d1111a75479d52046d8a71eb3b071581ee55489a Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Tue, 1 Nov 2016 20:25:27 -0700 Subject: [PATCH] btrfs: Call kunmap if zlib_inflateInit2 fails If zlib_inflateInit2 fails, the input page is never unmapped. Add a call to kunmap when it fails. Signed-off-by: Nick Terrell Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/zlib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c index 441b81a3e545..0ed90ccd81eb 100644 --- a/fs/btrfs/zlib.c +++ b/fs/btrfs/zlib.c @@ -250,6 +250,7 @@ static int zlib_decompress_biovec(struct list_head *ws, struct page **pages_in, if (Z_OK != zlib_inflateInit2(&workspace->strm, wbits)) { pr_warn("BTRFS: inflateInit failed\n"); + kunmap(pages_in[page_in_index]); return -EIO; } while (workspace->strm.total_in < srclen) {