--- sys/cam/cam_periph.c.orig +++ sys/cam/cam_periph.c @@ -325,8 +325,6 @@ struct mtx *mtx; int error; - mtx_assert(periph->sim->mtx, MA_OWNED); - /* * Increment the reference count on the peripheral * while we wait for our lock attempt to succeed @@ -338,6 +336,7 @@ return (ENXIO); mtx = periph->sim->mtx; + mtx_assert(mtx, MA_OWNED); if (mtx == &Giant) mtx = NULL;