From owner-svn-src-stable-11@freebsd.org Fri Dec 8 05:24:50 2017 Return-Path: Delivered-To: svn-src-stable-11@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 C5E14E9AB2A; Fri, 8 Dec 2017 05:24:50 +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 9284964773; Fri, 8 Dec 2017 05:24:50 +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 vB85On2o030707; Fri, 8 Dec 2017 05:24:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB85Ond7030706; Fri, 8 Dec 2017 05:24:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201712080524.vB85Ond7030706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 8 Dec 2017 05:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326678 - stable/11/sys/cam X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/sys/cam X-SVN-Commit-Revision: 326678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Dec 2017 05:24:50 -0000 Author: asomers Date: Fri Dec 8 05:24:49 2017 New Revision: 326678 URL: https://svnweb.freebsd.org/changeset/base/326678 Log: MFC r325857: 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 Sponsored by: Spectra Logic Corp Modified: stable/11/sys/cam/cam_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_xpt.c ============================================================================== --- stable/11/sys/cam/cam_xpt.c Fri Dec 8 05:20:54 2017 (r326677) +++ stable/11/sys/cam/cam_xpt.c Fri Dec 8 05:24:49 2017 (r326678) @@ -3900,7 +3900,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); }