diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2636a051e4b2..af7dbca15276 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1605,12 +1605,14 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) | |||
1605 | 1605 | ||
1606 | ret = find_next_devid(root, &device->devid); | 1606 | ret = find_next_devid(root, &device->devid); |
1607 | if (ret) { | 1607 | if (ret) { |
1608 | kfree(device->name); | ||
1608 | kfree(device); | 1609 | kfree(device); |
1609 | goto error; | 1610 | goto error; |
1610 | } | 1611 | } |
1611 | 1612 | ||
1612 | trans = btrfs_start_transaction(root, 0); | 1613 | trans = btrfs_start_transaction(root, 0); |
1613 | if (IS_ERR(trans)) { | 1614 | if (IS_ERR(trans)) { |
1615 | kfree(device->name); | ||
1614 | kfree(device); | 1616 | kfree(device); |
1615 | ret = PTR_ERR(trans); | 1617 | ret = PTR_ERR(trans); |
1616 | goto error; | 1618 | goto error; |