Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Fix a buglet in the driver's DMA buffer list ipm...



details:   https://anonhg.NetBSD.org/src/rev/9bbfef6959e5
branches:  trunk
changeset: 474528:9bbfef6959e5
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sat Jul 10 16:46:19 1999 +0000

description:
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.

diffstat:

 sys/dev/pci/eap.c |  14 +++++++-------
 sys/dev/pci/sv.c  |  14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diffs (58 lines):

diff -r b2760401ec05 -r 9bbfef6959e5 sys/dev/pci/eap.c
--- a/sys/dev/pci/eap.c Sat Jul 10 11:31:28 1999 +0000
+++ b/sys/dev/pci/eap.c Sat Jul 10 16:46:19 1999 +0000
@@ -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 @@
        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;
                }
        }
diff -r b2760401ec05 -r 9bbfef6959e5 sys/dev/pci/sv.c
--- a/sys/dev/pci/sv.c  Sat Jul 10 11:31:28 1999 +0000
+++ b/sys/dev/pci/sv.c  Sat Jul 10 16:46:19 1999 +0000
@@ -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 @@
        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;
                }
        }



Home | Main Index | Thread Index | Old Index