Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2017 05:24:49 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
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
Message-ID:  <201712080524.vB85Ond7030706@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712080524.vB85Ond7030706>