mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-18 02:36:56 +00:00
btrfs-progs: mkfs seg fault for wrong free
With commit
87c09f7
Btrfs-progs: fix memory leaks on cleanup
mkfs on multiple dev is ending with segfault at
close_all_devices() during kfree(device->name)
because mkfs calls btrfs_add_to_fsid, which does not initialize
name when dev is added to the list.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
ef85e7e285
commit
617efb6bb8
2
utils.c
2
utils.c
@ -482,7 +482,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
|
|||||||
u64 num_devs;
|
u64 num_devs;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
device = kmalloc(sizeof(*device), GFP_NOFS);
|
device = kzalloc(sizeof(*device), GFP_NOFS);
|
||||||
if (!device)
|
if (!device)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
buf = kmalloc(sectorsize, GFP_NOFS);
|
buf = kmalloc(sectorsize, GFP_NOFS);
|
||||||
|
Loading…
Reference in New Issue
Block a user