summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-03-18 07:17:10 +0000
committerpjd <pjd@FreeBSD.org>2004-03-18 07:17:10 +0000
commit5fae899223e346fe51816fb04ea9ecf3bc0439ea (patch)
tree9109102ca7e2ac6c8380c53732047f8fd3fe80bb /sys
parentf4bef7958a297f2fb9146941718d89b349de8023 (diff)
downloadFreeBSD-src-5fae899223e346fe51816fb04ea9ecf3bc0439ea.zip
FreeBSD-src-5fae899223e346fe51816fb04ea9ecf3bc0439ea.tar.gz
Move "is consumer attached?" check before G_VALID_PROVIDER() check,
because if consumer is not attached, its provider never will be valid, so we never reach this check. Approved by: phk
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/geom_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index e669e8c..cf8671d 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -584,12 +584,12 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int dce)
g_topology_assert();
G_VALID_CONSUMER(cp);
pp = cp->provider;
+ KASSERT(pp != NULL, ("access but not attached"));
G_VALID_PROVIDER(pp);
g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)",
cp, pp->name, dcr, dcw, dce);
- KASSERT(cp->provider != NULL, ("access but not attached"));
KASSERT(cp->acr + dcr >= 0, ("access resulting in negative acr"));
KASSERT(cp->acw + dcw >= 0, ("access resulting in negative acw"));
KASSERT(cp->ace + dce >= 0, ("access resulting in negative ace"));
OpenPOWER on IntegriCloud