diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5132c9af888a..8c027aa0020a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5731,7 +5731,7 @@ static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode, | |||
5731 | 5731 | ||
5732 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0); | 5732 | ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0); |
5733 | if (ret) | 5733 | if (ret) |
5734 | goto out_err; | 5734 | goto free_ordered; |
5735 | 5735 | ||
5736 | if (write && !skip_sum) { | 5736 | if (write && !skip_sum) { |
5737 | ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, | 5737 | ret = btrfs_wq_submit_bio(BTRFS_I(inode)->root->fs_info, |
@@ -5740,7 +5740,7 @@ static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode, | |||
5740 | __btrfs_submit_bio_start_direct_io, | 5740 | __btrfs_submit_bio_start_direct_io, |
5741 | __btrfs_submit_bio_done); | 5741 | __btrfs_submit_bio_done); |
5742 | if (ret) | 5742 | if (ret) |
5743 | goto out_err; | 5743 | goto free_ordered; |
5744 | return; | 5744 | return; |
5745 | } else if (!skip_sum) | 5745 | } else if (!skip_sum) |
5746 | btrfs_lookup_bio_sums_dio(root, inode, bio, | 5746 | btrfs_lookup_bio_sums_dio(root, inode, bio, |
@@ -5748,11 +5748,8 @@ static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode, | |||
5748 | 5748 | ||
5749 | ret = btrfs_map_bio(root, rw, bio, 0, 1); | 5749 | ret = btrfs_map_bio(root, rw, bio, 0, 1); |
5750 | if (ret) | 5750 | if (ret) |
5751 | goto out_err; | 5751 | goto free_ordered; |
5752 | return; | 5752 | return; |
5753 | out_err: | ||
5754 | kfree(dip->csums); | ||
5755 | kfree(dip); | ||
5756 | free_ordered: | 5753 | free_ordered: |
5757 | /* | 5754 | /* |
5758 | * If this is a write, we need to clean up the reserved space and kill | 5755 | * If this is a write, we need to clean up the reserved space and kill |