Make sure whether driver allocated resource before releasing it.

This commit is contained in:
Pyun YongHyeon 2010-12-18 23:24:59 +00:00
parent f25c5972da
commit cd33cef723

View File

@ -854,9 +854,11 @@ jme_detach(device_t dev)
}
}
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);
if (sc->jme_res[0] != NULL)
bus_release_resources(dev, sc->jme_res_spec, sc->jme_res);
mtx_destroy(&sc->jme_mtx);