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
This commit is contained in:
pjd 2004-03-18 07:17:10 +00:00
parent 3f852f008a
commit b55445b2aa

View File

@ -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"));