mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-07 01:31:17 +00:00
btrfs-progs: avoid double-free in __btrfs_map_block
__btrfs_map_block() can possibly do the goto again: loop after having allocated & freed the "multi" pointer. There are then a couple error conditions where it will attempt to again kfree the now non-NULL multi pointer. So before retrying, reset multi to NULL after we free it. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
This commit is contained in:
parent
b808cb66aa
commit
bbf1919b00
@ -1226,6 +1226,7 @@ again:
|
|||||||
if (multi_ret && stripes_allocated < stripes_required) {
|
if (multi_ret && stripes_allocated < stripes_required) {
|
||||||
stripes_allocated = stripes_required;
|
stripes_allocated = stripes_required;
|
||||||
kfree(multi);
|
kfree(multi);
|
||||||
|
multi = NULL;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
stripe_nr = offset;
|
stripe_nr = offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user