diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/fabrics.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index b1fa27b60917..c4345d1d98aa 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -92,8 +92,10 @@ static struct nvmf_host *nvmf_host_add(const char *hostnqn, uuid_t *id) } host = nvmf_host_alloc(hostnqn, id); - if (!host) - return ERR_PTR(-ENOMEM); + if (!host) { + host = ERR_PTR(-ENOMEM); + goto out_unlock; + } list_add_tail(&host->list, &nvmf_hosts); out_unlock: |