From af498ca9eb6e23defa7ddbead6fd1323ffeaedd8 Mon Sep 17 00:00:00 2001 From: Mike Silbersack Date: Wed, 19 Mar 2003 01:48:14 +0000 Subject: [PATCH] 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" --- sys/pci/if_xl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 2077c3cd3dad..e7a11bfacff5 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -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);