summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2008-12-19 14:27:10 +0000
committertrasz <trasz@FreeBSD.org>2008-12-19 14:27:10 +0000
commitaf71eefd2cdcc1021dd1f6c646b9de43bab7691d (patch)
tree50cc6c9bddf1bc79dc79ddc494e0ba1226168e08 /sys/cam
parente1a252e123d00883dfdada1b4a1567a5fbb1414f (diff)
downloadFreeBSD-src-af71eefd2cdcc1021dd1f6c646b9de43bab7691d.zip
FreeBSD-src-af71eefd2cdcc1021dd1f6c646b9de43bab7691d.tar.gz
Move mtx_assert lower, when we can be sure that the pointer
to the mutex is valid. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_periph.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 26fbc6e..7f15d80 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,7 @@ 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;
OpenPOWER on IntegriCloud