Date: Mon, 30 Mar 2009 08:48:33 +0000 (UTC) From: Weongyo Jeong <weongyo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r190544 - head/sys/dev/malo Message-ID: <200903300848.n2U8mXFc058572@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903300848.n2U8mXFc058572>