]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix leak of path in btrfs_find_item
authorDavid Sterba <dsterba@suse.cz>
Fri, 2 Jan 2015 17:45:16 +0000 (18:45 +0100)
committerDavid Sterba <dsterba@suse.cz>
Wed, 14 Jan 2015 18:23:46 +0000 (19:23 +0100)
commitebe291b4c5d4cd053a23cac94fb4c7b9e7d4ef88
tree024b49bf7f036ff79846076c44710337bd0d5ec1
parent965987c19682f64bdd8b57d2f524ab43dbed1995
btrfs: fix leak of path in btrfs_find_item

If btrfs_find_item is called with NULL path it allocates one locally but
does not free it. Affected paths are inserting an orphan item for a file
and for a subvol root.

Move the path allocation to the callers.

CC: <stable@vger.kernel.org> # 3.14+
Fixes: 3cc80b2fcfa3 ("btrfs: expand btrfs_find_item() to include find_orphan_item functionality")
Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/ctree.c
fs/btrfs/disk-io.c
fs/btrfs/tree-log.c