diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c index e66e8aae5e95..b6ceb57f2867 100644 --- a/sys/dev/mfi/mfi_cam.c +++ b/sys/dev/mfi/mfi_cam.c @@ -318,13 +318,16 @@ mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid) } sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); device_printf(sc->mfi_dev, "Cannot create path for bus rescan.\n"); return; } + mtx_unlock(&sc->mfi_io_lock); xpt_rescan(ccb);