Replace (deprecated ?) FREE() macro with direct calls to free()
This commit is contained in:
parent
ab6321e24a
commit
aa89f8d1c7
@ -375,7 +375,7 @@ bpfclose(dev, flags, fmt, td)
|
||||
mtx_unlock(&bpf_mtx);
|
||||
bpf_freed(d);
|
||||
dev->si_drv1 = 0;
|
||||
FREE(d, M_BPF);
|
||||
free(d, M_BPF);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ bsd_alloc(options, opt_len, decomp)
|
||||
MALLOC(db->lens, u_int16_t *, (maxmaxcode+1) * sizeof(db->lens[0]),
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
if (!db->lens) {
|
||||
FREE(db, M_DEVBUF);
|
||||
free(db, M_DEVBUF);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -377,8 +377,8 @@ bsd_free(state)
|
||||
struct bsd_db *db = (struct bsd_db *) state;
|
||||
|
||||
if (db->lens)
|
||||
FREE(db->lens, M_DEVBUF);
|
||||
FREE(db, M_DEVBUF);
|
||||
free(db->lens, M_DEVBUF);
|
||||
free(db, M_DEVBUF);
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -138,7 +138,7 @@ lo_clone_destroy(ifp)
|
||||
bpfdetach(ifp);
|
||||
if_detach(ifp);
|
||||
LIST_REMOVE(sc, sc_next);
|
||||
FREE(sc, M_LO);
|
||||
free(sc, M_LO);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -316,19 +316,19 @@ pppdealloc(sc)
|
||||
#endif /* PPP_COMPRESS */
|
||||
#ifdef PPP_FILTER
|
||||
if (sc->sc_pass_filt.bf_insns != 0) {
|
||||
FREE(sc->sc_pass_filt.bf_insns, M_DEVBUF);
|
||||
free(sc->sc_pass_filt.bf_insns, M_DEVBUF);
|
||||
sc->sc_pass_filt.bf_insns = 0;
|
||||
sc->sc_pass_filt.bf_len = 0;
|
||||
}
|
||||
if (sc->sc_active_filt.bf_insns != 0) {
|
||||
FREE(sc->sc_active_filt.bf_insns, M_DEVBUF);
|
||||
free(sc->sc_active_filt.bf_insns, M_DEVBUF);
|
||||
sc->sc_active_filt.bf_insns = 0;
|
||||
sc->sc_active_filt.bf_len = 0;
|
||||
}
|
||||
#endif /* PPP_FILTER */
|
||||
#ifdef VJC
|
||||
if (sc->sc_comp != 0) {
|
||||
FREE(sc->sc_comp, M_DEVBUF);
|
||||
free(sc->sc_comp, M_DEVBUF);
|
||||
sc->sc_comp = 0;
|
||||
}
|
||||
#endif
|
||||
@ -536,11 +536,11 @@ pppioctl(sc, cmd, data, flag, td)
|
||||
}
|
||||
if ((error = copyin((caddr_t)nbp->bf_insns, (caddr_t)newcode,
|
||||
newcodelen)) != 0) {
|
||||
FREE(newcode, M_DEVBUF);
|
||||
free(newcode, M_DEVBUF);
|
||||
break;
|
||||
}
|
||||
if (!bpf_validate(newcode, nbp->bf_len)) {
|
||||
FREE(newcode, M_DEVBUF);
|
||||
free(newcode, M_DEVBUF);
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
@ -553,7 +553,7 @@ pppioctl(sc, cmd, data, flag, td)
|
||||
bp->bf_insns = newcode;
|
||||
splx(s);
|
||||
if (oldcode != 0)
|
||||
FREE(oldcode, M_DEVBUF);
|
||||
free(oldcode, M_DEVBUF);
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
@ -251,7 +251,7 @@ slmarkstatic(unit)
|
||||
|
||||
if (st_unit_list) {
|
||||
bcopy(st_unit_list, t, sizeof(int) * st_unit_max);
|
||||
FREE(st_unit_list, M_SL);
|
||||
free(st_unit_list, M_SL);
|
||||
}
|
||||
st_unit_list = t;
|
||||
st_unit_list[st_unit_max] = unit;
|
||||
@ -278,7 +278,7 @@ slcreate()
|
||||
|
||||
if (m == NULL) {
|
||||
printf("sl: can't allocate buffer\n");
|
||||
FREE(sc, M_SL);
|
||||
free(sc, M_SL);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -388,8 +388,8 @@ sldestroy(struct sl_softc *sc)
|
||||
m_free(sc->sc_mbuf);
|
||||
mtx_destroy(&sc->sc_fastq.ifq_mtx);
|
||||
if (sc->bpfbuf)
|
||||
FREE(sc->bpfbuf, M_SL);
|
||||
FREE(sc, M_SL);
|
||||
free(sc->bpfbuf, M_SL);
|
||||
free(sc, M_SL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -223,7 +223,7 @@ tapmodevent(mod, type, data)
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
splx(s);
|
||||
|
||||
FREE(tp, M_TAP);
|
||||
free(tp, M_TAP);
|
||||
}
|
||||
|
||||
if (tapbasedev != NOUDEV)
|
||||
|
@ -188,7 +188,7 @@ tunmodevent(module_t mod, int type, void *data)
|
||||
bpfdetach(&tp->tun_if);
|
||||
if_detach(&tp->tun_if);
|
||||
KASSERT(dev->si_flags & SI_NAMED, ("Missing make_dev"));
|
||||
FREE(tp, M_TUN);
|
||||
free(tp, M_TUN);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -134,7 +134,7 @@ z_free(notused, ptr)
|
||||
void *notused;
|
||||
void *ptr;
|
||||
{
|
||||
FREE(ptr, M_DEVBUF);
|
||||
free(ptr, M_DEVBUF);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -168,7 +168,7 @@ z_comp_alloc(options, opt_len)
|
||||
state->strm.zfree = z_free;
|
||||
if (deflateInit2(&state->strm, Z_DEFAULT_COMPRESSION, DEFLATE_METHOD_VAL,
|
||||
-w_size, 8, Z_DEFAULT_STRATEGY) != Z_OK) {
|
||||
FREE(state, M_DEVBUF);
|
||||
free(state, M_DEVBUF);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ z_comp_free(arg)
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
deflateEnd(&state->strm);
|
||||
FREE(state, M_DEVBUF);
|
||||
free(state, M_DEVBUF);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -397,7 +397,7 @@ z_decomp_alloc(options, opt_len)
|
||||
state->strm.zalloc = z_alloc;
|
||||
state->strm.zfree = z_free;
|
||||
if (inflateInit2(&state->strm, -w_size) != Z_OK) {
|
||||
FREE(state, M_DEVBUF);
|
||||
free(state, M_DEVBUF);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ z_decomp_free(arg)
|
||||
struct deflate_state *state = (struct deflate_state *) arg;
|
||||
|
||||
inflateEnd(&state->strm);
|
||||
FREE(state, M_DEVBUF);
|
||||
free(state, M_DEVBUF);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user