]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup
authorChris Mason <clm@fb.com>
Tue, 4 Nov 2014 14:59:04 +0000 (06:59 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 13 Nov 2014 18:03:08 +0000 (19:03 +0100)
commitaf38815938285cb19a5f489cc4e65e4862c149fa
tree2c9fcff00aaddc88efa70ac2da32e092eed224e2
parentba82a2ab8f266a3c9c3f4364339fb4932b4cba36
Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup

commit 6e5aafb27419f32575b27ef9d6a31e5d54661aca upstream.

If we hit any errors in btrfs_lookup_csums_range, we'll loop through all
the csums we allocate and free them.  But the code was using list_entry
incorrectly, and ended up trying to free the on-stack list_head instead.

This bug came from commit 0678b6185

btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range()

Signed-off-by: Chris Mason <clm@fb.com>
Reported-by: Erik Berg <btrfs@slipsprogrammoer.no>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/btrfs/file-item.c