diff mbox

BTRFS: Fix mem leak in btrfs_submit_direct()

Message ID alpine.LNX.2.00.1103132145250.29706@swampdragon.chaosbits.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jesper Juhl March 13, 2011, 8:49 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0efdb65..53f4c8e 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6056,6 +6056,7 @@  static void btrfs_submit_direct(int rw, struct bio *bio, struct inode *inode,
 	if (!skip_sum) {
 		dip->csums = kmalloc(sizeof(u32) * bio->bi_vcnt, GFP_NOFS);
 		if (!dip->csums) {
+			kfree(dip);
 			ret = -ENOMEM;
 			goto free_ordered;
 		}