Fix a buglet in the driver's DMA buffer list ipmlementation, causing the next-
in-list (wrong) descriptor structure of the buffer in question to be freed.
This commit is contained in:
parent
247bd5d560
commit
2422638ad5
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: eap.c,v 1.25 1999/02/18 07:59:30 mycroft Exp $ */
|
||||
/* $NetBSD: eap.c,v 1.26 1999/07/10 16:46:19 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -1298,13 +1298,13 @@ eap_free(addr, ptr, pool)
|
|||
int pool;
|
||||
{
|
||||
struct eap_softc *sc = addr;
|
||||
struct eap_dma **p;
|
||||
struct eap_dma **pp, *p;
|
||||
|
||||
for (p = &sc->sc_dmas; *p; p = &(*p)->next) {
|
||||
if (KERNADDR(*p) == ptr) {
|
||||
eap_freemem(sc, *p);
|
||||
*p = (*p)->next;
|
||||
free(*p, pool);
|
||||
for (pp = &sc->sc_dmas; (p = *pp) != NULL; pp = &p->next) {
|
||||
if (KERNADDR(p) == ptr) {
|
||||
eap_freemem(sc, p);
|
||||
*pp = p->next;
|
||||
free(p, pool);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sv.c,v 1.8 1999/04/14 03:26:34 jonathan Exp $ */
|
||||
/* $NetBSD: sv.c,v 1.9 1999/07/10 16:46:19 kleink Exp $ */
|
||||
/* $OpenBSD: sv.c,v 1.2 1998/07/13 01:50:15 csapuntz Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -1459,13 +1459,13 @@ sv_free(addr, ptr, pool)
|
|||
int pool;
|
||||
{
|
||||
struct sv_softc *sc = addr;
|
||||
struct sv_dma **p;
|
||||
struct sv_dma **pp, *p;
|
||||
|
||||
for (p = &sc->sc_dmas; *p; p = &(*p)->next) {
|
||||
if (KERNADDR(*p) == ptr) {
|
||||
sv_freemem(sc, *p);
|
||||
*p = (*p)->next;
|
||||
free(*p, pool);
|
||||
for (pp = &sc->sc_dmas; (p = *pp) != NULL; pp = &p->next) {
|
||||
if (KERNADDR(p) == ptr) {
|
||||
sv_freemem(sc, p);
|
||||
*pp = p->next;
|
||||
free(p, pool);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue