svn commit: r246441 - stable/9/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Wed Feb 6 22:32:46 UTC 2013


Author: mav
Date: Wed Feb  6 22:32:45 2013
New Revision: 246441
URL: http://svnweb.freebsd.org/changeset/base/246441

Log:
  MFC r244016 (by ken):
  Make sure we hold the SIM lock when calling xpt_free_path().
  
  Sponsored by:   Spectra Logic Corporation

Modified:
  stable/9/sys/cam/ctl/scsi_ctl.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- stable/9/sys/cam/ctl/scsi_ctl.c	Wed Feb  6 22:30:40 2013	(r246440)
+++ stable/9/sys/cam/ctl/scsi_ctl.c	Wed Feb  6 22:32:45 2013	(r246441)
@@ -1822,8 +1822,6 @@ ctlfe_onoffline(void *arg, int online)
 
 	xpt_action(ccb);
 
-	CAM_SIM_UNLOCK(sim);
-
 	if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
 		printf("%s: SIM %s (path id %d) target %s failed with "
 		       "status %#x\n",
@@ -1836,9 +1834,12 @@ ctlfe_onoffline(void *arg, int online)
 		       (online != 0) ? "enable" : "disable");
 	}
 
-	free(ccb, M_TEMP);
 	xpt_free_path(path);
 
+	CAM_SIM_UNLOCK(sim);
+
+	free(ccb, M_TEMP);
+
 	return;
 }
 
@@ -1920,10 +1921,10 @@ ctlfe_lun_enable(void *arg, struct ctl_i
 				  0,
 				  softc);
 
-	mtx_unlock(sim->mtx);
-
 	xpt_free_path(path);
 
+	mtx_unlock(sim->mtx);
+
 	return (0);
 }
 


More information about the svn-src-stable mailing list