diff options
author | Nick Terrell <nickrterrell@gmail.com> | 2016-11-01 20:25:27 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-30 13:45:18 +0100 |
commit | d1111a75479d52046d8a71eb3b071581ee55489a (patch) | |
tree | 82cf101f8f6610d0906a4b296723b674f1806a36 | |
parent | ed0df618b1b06d7431ee4d985317fc5419a5d559 (diff) | |
download | linux-d1111a75479d52046d8a71eb3b071581ee55489a.tar.gz linux-d1111a75479d52046d8a71eb3b071581ee55489a.tar.bz2 linux-d1111a75479d52046d8a71eb3b071581ee55489a.zip |
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 <nickrterrell@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/zlib.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) { |