mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Move releasing of resources to later
Turn off bus master after we detach the device (to match the prior order). Release MSI after we're done detaching and have turned off all the interrupts. Otherwise this may cause problems as other threads race nvme_detach. This more closely matches the old order. Reviewed by: mav@
This commit is contained in:
parent
92a8983bab
commit
ec743e0c33
1 changed files with 3 additions and 1 deletions
|
|
@ -215,11 +215,13 @@ static int
|
|||
nvme_pci_detach(device_t dev)
|
||||
{
|
||||
struct nvme_controller*ctrlr = DEVICE2SOFTC(dev);
|
||||
int rv;
|
||||
|
||||
rv = nvme_detach(dev);
|
||||
if (ctrlr->msix_enabled)
|
||||
pci_release_msi(dev);
|
||||
pci_disable_busmaster(dev);
|
||||
return (nvme_detach(dev));
|
||||
return (rv);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue