Commit 432f8d91 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/423616


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarKunal Sablok <kunal.sablok@intel.com>
parent 2c608684
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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;
	}