bdev/raid: Fix uncorrect cleanup call in raid_bdev_alloc_base_bdev_resource()

When raid_bdev_alloc_base_bdev_resource() is called through raid_bdev_examine(),
if raid_bdev_alloc_base_bdev_resource() fails, raid_bdev_cleanup() is called
without freeing base bdev resource.

There is no way to free base bdev resource in this case.

Hence remove cleanup call.

Change-Id: I93494502bfe653293825e11872de5883702e495a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/423616
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Kunal Sablok <kunal.sablok@intel.com>
This commit is contained in:
Shuhei Matsumoto 2018-08-28 09:58:58 +09:00 committed by Jim Harris
parent 2c608684ff
commit 432f8d9160

View File

@ -1427,7 +1427,6 @@ raid_bdev_add_base_device(struct spdk_bdev *bdev)
rc = raid_bdev_alloc_base_bdev_resource(raid_bdev, bdev, base_bdev_slot);
if (rc != 0) {
SPDK_ERRLOG("Failed to allocate resource for bdev '%s'\n", bdev->name);
raid_bdev_cleanup(raid_bdev);
return rc;
}