From owner-svn-src-all@FreeBSD.ORG Sun Mar 1 21:41:36 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 1A041C46; Sun, 1 Mar 2015 21:41:36 +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 053AE9A3; Sun, 1 Mar 2015 21:41:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t21LfZvD093295; Sun, 1 Mar 2015 21:41:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t21LfZrs093294; Sun, 1 Mar 2015 21:41:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201503012141.t21LfZrs093294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2015 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279501 - head/sys/dev/pci X-SVN-Group: head 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: Sun, 01 Mar 2015 21:41:36 -0000 Author: imp Date: Sun Mar 1 21:41:35 2015 New Revision: 279501 URL: https://svnweb.freebsd.org/changeset/base/279501 Log: Don't leak 'used' in a few error cases. Reported by: Maxime Villard Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Mar 1 21:41:33 2015 (r279500) +++ head/sys/dev/pci/pci.c Sun Mar 1 21:41:35 2015 (r279501) @@ -1702,12 +1702,16 @@ pci_remap_msix_method(device_t dev, devi for (i = 0; i < msix->msix_table_len; i++) { if (msix->msix_table[i].mte_vector == 0) continue; - if (msix->msix_table[i].mte_handlers > 0) + if (msix->msix_table[i].mte_handlers > 0) { + free(used, M_DEVBUF); return (EBUSY); + } rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, i + 1); KASSERT(rle != NULL, ("missing resource")); - if (rle->res != NULL) + if (rle->res != NULL) { + free(used, M_DEVBUF); return (EBUSY); + } } /* Free the existing resource list entries. */