diff options
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r-- | sys/cam/cam_periph.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 26fbc6e..907c801 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -311,8 +311,6 @@ cam_periph_hold(struct cam_periph *periph, int priority) 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 @@ -324,6 +322,8 @@ cam_periph_hold(struct cam_periph *periph, int priority) return (ENXIO); mtx = periph->sim->mtx; + mtx_assert(mtx, MA_OWNED); + if (mtx == &Giant) mtx = NULL; |