Date: Thu, 2 Oct 2014 15:03:51 +0000 (UTC) From: "George V. Neville-Neil" <gnn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272411 - head/sys/dev/sfxge Message-ID: <201410021503.s92F3p6B027837@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gnn Date: Thu Oct 2 15:03:51 2014 New Revision: 272411 URL: https://svnweb.freebsd.org/changeset/base/272411 Log: Properly handle a case that should never happen (the bus_dma callback being called with error set to non-zero). Modified: head/sys/dev/sfxge/sfxge_dma.c Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Thu Oct 2 12:27:41 2014 (r272410) +++ head/sys/dev/sfxge/sfxge_dma.c Thu Oct 2 15:03:51 2014 (r272411) @@ -164,11 +164,14 @@ sfxge_dma_alloc(struct sfxge_softc *sc, /* * The callback gets error information about the mapping - * and will have set our vaddr to NULL if something went + * and will have set esm_addr to 0 if something went * wrong. */ - if (vaddr == NULL) + if (esmp->esm_addr == 0) { + bus_dmamem_free(esmp->esm_tag, esmp->esm_base, esmp->esm_map); + bus_dma_tag_destroy(esmp->esm_tag); return (ENOMEM); + } esmp->esm_base = vaddr;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410021503.s92F3p6B027837>