nvme: destruct the ctrlr when failing to construct it

Change-Id: Idbd1d4ea8c47d78daf0cceb3a4eda1afe4d688a2
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2016-10-18 20:34:33 -04:00 committed by Daniel Verkamp
parent 11381f3b3c
commit a7399d6bf7

View File

@ -324,7 +324,7 @@ static struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(void *devhandle)
rc = nvme_ctrlr_construct(&pctrlr->ctrlr);
if (rc != 0) {
spdk_free(pctrlr);
nvme_ctrlr_destruct(&pctrlr->ctrlr);
return NULL;
}