svn commit: r190544 - head/sys/dev/malo
Weongyo Jeong
weongyo at FreeBSD.org
Mon Mar 30 01:48:34 PDT 2009
Author: weongyo
Date: Mon Mar 30 08:48:33 2009
New Revision: 190544
URL: http://svn.freebsd.org/changeset/base/190544
Log:
handles more exceptional cases when the driver failed to attach.
MFC after: 3 days
Modified:
head/sys/dev/malo/if_malo_pci.c
Modified: head/sys/dev/malo/if_malo_pci.c
==============================================================================
--- head/sys/dev/malo/if_malo_pci.c Mon Mar 30 08:47:28 2009 (r190543)
+++ head/sys/dev/malo/if_malo_pci.c Mon Mar 30 08:48:33 2009 (r190544)
@@ -260,12 +260,13 @@ malo_pci_attach(device_t dev)
error = malo_attach(pci_get_device(dev), sc);
- if (error != 0) {
- malo_pci_detach(dev);
- return (error);
- }
+ if (error != 0)
+ goto bad2;
return (error);
+
+bad2:
+ bus_dma_tag_destroy(sc->malo_dmat);
bad1:
if (psc->malo_msi == 0)
bus_teardown_intr(dev, psc->malo_res_irq[0],
@@ -275,10 +276,11 @@ bad1:
bus_teardown_intr(dev, psc->malo_res_irq[i],
psc->malo_intrhand[i]);
}
-
+ bus_release_resources(dev, psc->malo_irq_spec, psc->malo_res_irq);
bad:
if (psc->malo_msi != 0)
pci_release_msi(dev);
+ bus_release_resources(dev, psc->malo_mem_spec, psc->malo_res_mem);
return (error);
}
More information about the svn-src-all
mailing list