[PATCH 10/10] btrfs: Remove out label in btrfs_submit_compressed_read

Nikolay Borisov
2020-07-02T13:47:00Z

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/compression.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index c28ee9fcd15d..f9a9ec51a1ec 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -678,8 +678,10 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,

compressed_len = em->block_len;
cb = kmalloc(compressed_bio_size(fs_info, compressed_len), GFP_NOFS);
- if (!cb)
- goto out;
+ if (!cb) {
+ free_extent_map(em);
+ return BLK_STS_RESOURCE;
+ }

refcount_set(&cb->pending_bios, 0);
cb->errors = 0;
@@ -803,10 +805,6 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
}

return 0;
-
-out:
- free_extent_map(em);
- return ret;
}

/*
--
2.17.1