From owner-svn-src-head@freebsd.org Wed Nov 15 15:52:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B16DE0B61; Wed, 15 Nov 2017 15:52:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 C33F97008A; Wed, 15 Nov 2017 15:52:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAFFq6d8033719; Wed, 15 Nov 2017 15:52:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAFFq6vW033718; Wed, 15 Nov 2017 15:52:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711151552.vAFFq6vW033718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 15 Nov 2017 15:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325857 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 325857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 15:52:08 -0000 Author: asomers Date: Wed Nov 15 15:52:06 2017 New Revision: 325857 URL: https://svnweb.freebsd.org/changeset/base/325857 Log: Remove a double free(9) in xpt_bus_register In xpt_bus_register(), remove superfluous call to free(). This was mostly benign since free(9) checks for NULL before doing anything, and xpt_create_path() is nice enough to NULL out the pointer on failure. However, it could've segfaulted if malloc(9) failed during xpt_create_path(). Submitted by: gibbs MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Nov 15 15:24:28 2017 (r325856) +++ head/sys/cam/cam_xpt.c Wed Nov 15 15:52:06 2017 (r325857) @@ -4049,7 +4049,6 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { xpt_release_bus(new_bus); - free(path, M_CAMXPT); return (CAM_RESRC_UNAVAIL); }