[Midnightbsd-cvs] src [8753] trunk/sys/cam/ctl/scsi_ctl.c: Make sure we hold the SIM lock when calling xpt_free_path

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 22:37:24 EDT 2016


Revision: 8753
          http://svnweb.midnightbsd.org/src/?rev=8753
Author:   laffer1
Date:     2016-09-25 22:37:24 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
Make sure we hold the SIM lock when calling xpt_free_path

Modified Paths:
--------------
    trunk/sys/cam/ctl/scsi_ctl.c

Modified: trunk/sys/cam/ctl/scsi_ctl.c
===================================================================
--- trunk/sys/cam/ctl/scsi_ctl.c	2016-09-26 02:36:48 UTC (rev 8752)
+++ trunk/sys/cam/ctl/scsi_ctl.c	2016-09-26 02:37:24 UTC (rev 8753)
@@ -1822,8 +1822,6 @@
 
 	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 @@
 		       (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 @@
 				  0,
 				  softc);
 
+	xpt_free_path(path);
+
 	mtx_unlock(sim->mtx);
 
-	xpt_free_path(path);
-
 	return (0);
 }
 



More information about the Midnightbsd-cvs mailing list