]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 22:53:05 +0000 (14:53 -0800)
commit751e276c003c2cf6f87237b5d8a91628ab542447
treed3060c59c6904208580542a753e70a23053f2375
parentb4d32c368882b4703b9b5207e20917e74d4097a9
btrfs: fix leak of path in btrfs_find_item

commit 381cf6587f8a8a8e981bc0c1aaaa8859b51dc756 upstream.

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.

Fixes: 3f870c289900 ("btrfs: expand btrfs_find_item() to include find_orphan_item functionality")
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ctree.c
fs/btrfs/disk-io.c
fs/btrfs/tree-log.c