diff options
author | Weongyo Jeong <weongyo@FreeBSD.org> | 2009-03-30 08:48:33 +0000 |
---|---|---|
committer | Weongyo Jeong <weongyo@FreeBSD.org> | 2009-03-30 08:48:33 +0000 |
commit | df1af10875fcd289335b402ca6300a5eb8e63b0b (patch) | |
tree | f3aaf74914ae65ec48d90c7db744d96c68c715ab /sys | |
parent | 2b0b4ee3592d5074ee6391bda886bdc48d168c5a (diff) | |
download | src-df1af10875fcd289335b402ca6300a5eb8e63b0b.tar.gz src-df1af10875fcd289335b402ca6300a5eb8e63b0b.zip |
handles more exceptional cases when the driver failed to attach.
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=190544
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/malo/if_malo_pci.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/malo/if_malo_pci.c b/sys/dev/malo/if_malo_pci.c index 8a3b346da82b..49ae74d2c2ea 100644 --- a/sys/dev/malo/if_malo_pci.c +++ b/sys/dev/malo/if_malo_pci.c @@ -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); } |