From 432f8d916070678d431ee25acbfa0ba3b1c173ce Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 28 Aug 2018 09:58:58 +0900 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/423616 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Ben Walker Reviewed-by: Kunal Sablok --- lib/bdev/raid/bdev_raid.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/bdev/raid/bdev_raid.c b/lib/bdev/raid/bdev_raid.c index 952ab1075..25f664828 100644 --- a/lib/bdev/raid/bdev_raid.c +++ b/lib/bdev/raid/bdev_raid.c @@ -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; }