summaryrefslogtreecommitdiffstats
path: root/sys/dev/tws/tws_cam.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/tws/tws_cam.c')
-rw-r--r--sys/dev/tws/tws_cam.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/tws/tws_cam.c b/sys/dev/tws/tws_cam.c
index 657777a..d988349 100644
--- a/sys/dev/tws/tws_cam.c
+++ b/sys/dev/tws/tws_cam.c
@@ -217,17 +217,16 @@ tws_bus_scan(struct tws_softc *sc)
TWS_TRACE_DEBUG(sc, "entry", sc, 0);
if (!(sc->sim))
return(ENXIO);
- mtx_assert(&sc->sim_lock, MA_OWNED);
- if ((ccb = xpt_alloc_ccb()) == NULL)
- return(ENOMEM);
-
+ ccb = xpt_alloc_ccb();
+ mtx_lock(&sc->sim_lock);
if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+ mtx_unlock(&sc->sim_lock);
xpt_free_ccb(ccb);
return(EIO);
}
xpt_rescan(ccb);
-
+ mtx_unlock(&sc->sim_lock);
return(0);
}
OpenPOWER on IntegriCloud