Make sure to free the correct resources when the card fails to attach

properly.  (Broken in the previous commit.)

Noticed by:	"Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
This commit is contained in:
Mike Silbersack 2003-03-19 01:48:14 +00:00
parent ba39e1347e
commit af498ca9eb

View File

@ -1738,6 +1738,14 @@ xl_attach(dev)
bus_release_resource(dev, SYS_RES_MEMORY, XL_PCI_FUNCMEM,
sc->xl_fres);
fail_res:
if (sc->xl_flags & XL_FLAG_USE_MMIO) {
rid = XL_PCI_LOMEM;
res = SYS_RES_MEMORY;
} else {
rid = XL_PCI_LOIO;
res = SYS_RES_IOPORT;
}
bus_release_resource(dev, res, rid, sc->xl_res);
fail:
XL_UNLOCK(sc);