Dan Carpenter
2011-Aug-05 14:19 UTC
[patch] btrfs: memory leak in btrfs_add_inode_defrag()
We don''t use the defrag struct on this path. Signed-off-by: Dan Carpenter <error27@gmail.com> 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, spin_lock(&root->fs_info->defrag_inodes_lock); if (!BTRFS_I(inode)->in_defrag) __btrfs_add_inode_defrag(inode, defrag); + else + kfree(defrag); spin_unlock(&root->fs_info->defrag_inodes_lock); return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html