Date: Wed, 25 Mar 2015 10:08:29 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280507 - stable/10/sys/dev/sfxge Message-ID: <201503251008.t2PA8Tc6073571@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Wed Mar 25 10:08:28 2015 New Revision: 280507 URL: https://svnweb.freebsd.org/changeset/base/280507 Log: MFC: 272411 Properly handle a case that should never happen (the bus_dma callback being called with error set to non-zero). Modified: stable/10/sys/dev/sfxge/sfxge_dma.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:06:26 2015 (r280506) +++ stable/10/sys/dev/sfxge/sfxge_dma.c Wed Mar 25 10:08:28 2015 (r280507) @@ -160,11 +160,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?201503251008.t2PA8Tc6073571>