Make sure whether driver allocated resource before releasing it.
This commit is contained in:
parent
f25c5972da
commit
cd33cef723
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216549
@ -854,10 +854,12 @@ jme_detach(device_t dev)
|
||||
}
|
||||
}
|
||||
|
||||
bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq);
|
||||
if (sc->jme_irq[0] != NULL)
|
||||
bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq);
|
||||
if ((sc->jme_flags & (JME_FLAG_MSIX | JME_FLAG_MSI)) != 0)
|
||||
pci_release_msi(dev);
|
||||
bus_release_resources(dev, sc->jme_res_spec, sc->jme_res);
|
||||
if (sc->jme_res[0] != NULL)
|
||||
bus_release_resources(dev, sc->jme_res_spec, sc->jme_res);
|
||||
mtx_destroy(&sc->jme_mtx);
|
||||
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user