From owner-svn-src-all@FreeBSD.ORG Wed Mar 25 10:08:29 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 406385EF; Wed, 25 Mar 2015 10:08:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC52354; Wed, 25 Mar 2015 10:08:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PA8TvW073572; Wed, 25 Mar 2015 10:08:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PA8Tc6073571; Wed, 25 Mar 2015 10:08:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251008.t2PA8Tc6073571@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:08:29 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 10:08:29 -0000 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;