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

Kenneth D. Merry ken at FreeBSD.org
Wed Feb 15 17:46:17 UTC 2012


Author: ken
Date: Wed Feb 15 17:46:16 2012
New Revision: 231773
URL: http://svn.freebsd.org/changeset/base/231773

Log:
  MFC r231092
  
    r231092 | emaste | 2012-02-06 11:11:00 -0700 (Mon, 06 Feb 2012) | 4 lines
  
    Avoid panic from unlocking a not locked mutex (in some error cases).
  
    Reviewed by:	ken@

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

Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c	Wed Feb 15 17:28:09 2012	(r231772)
+++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c	Wed Feb 15 17:46:16 2012	(r231773)
@@ -221,6 +221,7 @@ cfcs_init(void)
 
 	mtx_lock(&softc->lock);
 	if (xpt_bus_register(softc->sim, NULL, 0) != CAM_SUCCESS) {
+		mtx_unlock(&softc->lock);
 		printf("%s: error registering SIM\n", __func__);
 		retval = ENOMEM;
 		goto bailout;
@@ -230,6 +231,7 @@ cfcs_init(void)
 			    cam_sim_path(softc->sim),
 			    CAM_TARGET_WILDCARD,
 			    CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+		mtx_unlock(&softc->lock);
 		printf("%s: error creating path\n", __func__);
 		xpt_bus_deregister(cam_sim_path(softc->sim));
 		retval = 1;
@@ -253,8 +255,6 @@ bailout:
 	else if (softc->devq)
 		cam_simq_free(softc->devq);
 
-	mtx_unlock(&softc->lock);
-
 	return (retval);
 }
 


More information about the svn-src-stable-9 mailing list