btrfs: fix dip leak

The btrfs DIO code leaks dip structs when dip->csums allocation
fails; bio->bi_end_io isn't set at the point where the free_ordered
branch is consequently taken, thus bio_endio doesn't call the function
which would free it in the normal case. Fix.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>
Acked-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

authored by Daniel J Blueman and committed by Chris Mason b4966b77 ea8efc74

+1
+1
fs/btrfs/inode.c
··· 6058 6058 if (!skip_sum) { 6059 6059 dip->csums = kmalloc(sizeof(u32) * bio->bi_vcnt, GFP_NOFS); 6060 6060 if (!dip->csums) { 6061 + kfree(dip); 6061 6062 ret = -ENOMEM; 6062 6063 goto free_ordered; 6063 6064 }