mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
nvme-pci: add missing unlock for reset error
The reset work holds a mutex to prevent races with removal modifying the
same resources, but was unlocking only on success. Unlock on failure
too.
Fixes: 5c959d73db
("nvme-pci: fix rapid add remove sequence")
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
aef1897cd3
commit
4726bcf30f
1 changed files with 5 additions and 3 deletions
|
@ -2560,15 +2560,15 @@ static void nvme_reset_work(struct work_struct *work)
|
||||||
mutex_lock(&dev->shutdown_lock);
|
mutex_lock(&dev->shutdown_lock);
|
||||||
result = nvme_pci_enable(dev);
|
result = nvme_pci_enable(dev);
|
||||||
if (result)
|
if (result)
|
||||||
goto out;
|
goto out_unlock;
|
||||||
|
|
||||||
result = nvme_pci_configure_admin_queue(dev);
|
result = nvme_pci_configure_admin_queue(dev);
|
||||||
if (result)
|
if (result)
|
||||||
goto out;
|
goto out_unlock;
|
||||||
|
|
||||||
result = nvme_alloc_admin_tags(dev);
|
result = nvme_alloc_admin_tags(dev);
|
||||||
if (result)
|
if (result)
|
||||||
goto out;
|
goto out_unlock;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Limit the max command size to prevent iod->sg allocations going
|
* Limit the max command size to prevent iod->sg allocations going
|
||||||
|
@ -2651,6 +2651,8 @@ static void nvme_reset_work(struct work_struct *work)
|
||||||
nvme_start_ctrl(&dev->ctrl);
|
nvme_start_ctrl(&dev->ctrl);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
out_unlock:
|
||||||
|
mutex_unlock(&dev->shutdown_lock);
|
||||||
out:
|
out:
|
||||||
nvme_remove_dead_ctrl(dev, result);
|
nvme_remove_dead_ctrl(dev, result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue