btrfs: memory leak in btrfs_add_inode_defrag()
diff mbox

Message ID 20110805141900.GL7659@shale.localdomain
State New, archived
Headers show

Commit Message

Dan Carpenter Aug. 5, 2011, 2:19 p.m. UTC
We don't use the defrag struct on this path.

Signed-off-by: Dan Carpenter <>

To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to
More majordomo info at

diff mbox

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 658d669..1102059 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -150,6 +150,8 @@  int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans,
 	if (!BTRFS_I(inode)->in_defrag)
 		__btrfs_add_inode_defrag(inode, defrag);
+	else
+		kfree(defrag);
 	return 0;