diff options
author | Anand Jain <anand.jain@oracle.com> | 2013-04-26 10:44:45 +0800 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-05-02 22:30:02 -0400 |
commit | 617efb6bb8cd3afbfd36411925469537be218229 (patch) | |
tree | cad1fd3873adcee389d3b1ec99ed8f34e94a1ae2 | |
parent | ef85e7e285daf3927f7821618849d3545a20ecb9 (diff) |
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>
-rw-r--r-- | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -482,7 +482,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, u64 num_devs; int ret; - device = kmalloc(sizeof(*device), GFP_NOFS); + device = kzalloc(sizeof(*device), GFP_NOFS); if (!device) return -ENOMEM; buf = kmalloc(sectorsize, GFP_NOFS); |