Eliminate CID 1842 by comparing against (type != EXT_MBUF) => refcnt != NULL

This commit is contained in:
Kip Macy 2007-04-20 05:12:54 +00:00
parent f297a9d336
commit 527888d7c0

View File

@ -348,7 +348,8 @@ mb_free_vec(struct mbuf *m)
int type = mbuf_vec_get_type(mv, i);
void *cl = mv->mv_vec[i].mi_base;
if (refcnt && *refcnt != 1 && atomic_fetchadd_int(refcnt, -1) != 1)
if ((type != EXT_MBUF) && *refcnt != 1 &&
atomic_fetchadd_int(refcnt, -1) != 1)
continue;
DPRINTF("freeing idx=%d refcnt=%p type=%d cl=%p\n", i, refcnt, type, cl);