Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/qbus Fix dmamap cleanup in an error path



details:   https://anonhg.NetBSD.org/src/rev/aaad7e1695f9
branches:  trunk
changeset: 790866:aaad7e1695f9
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Oct 25 15:42:50 2013 +0000

description:
Fix dmamap cleanup in an error path

diffstat:

 sys/dev/qbus/if_qe.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (54 lines):

diff -r 15b010db2188 -r aaad7e1695f9 sys/dev/qbus/if_qe.c
--- a/sys/dev/qbus/if_qe.c      Fri Oct 25 15:27:03 2013 +0000
+++ b/sys/dev/qbus/if_qe.c      Fri Oct 25 15:42:50 2013 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_qe.c,v 1.71 2010/04/05 07:21:47 joerg Exp $ */
+/*      $NetBSD: if_qe.c,v 1.72 2013/10/25 15:42:50 martin Exp $ */
 /*
  * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
  *
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.71 2010/04/05 07:21:47 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.72 2013/10/25 15:42:50 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -372,13 +372,13 @@
        }
  fail_5:
        for (i = 0; i < RXDESCS; i++) {
-               if (sc->sc_xmtmap[i] != NULL)
-                       bus_dmamap_destroy(sc->sc_dmat, sc->sc_xmtmap[i]);
+               if (sc->sc_rcvmap[i] != NULL)
+                       bus_dmamap_destroy(sc->sc_dmat, sc->sc_rcvmap[i]);
        }
  fail_4:
        for (i = 0; i < TXDESCS; i++) {
-               if (sc->sc_rcvmap[i] != NULL)
-                       bus_dmamap_destroy(sc->sc_dmat, sc->sc_rcvmap[i]);
+               if (sc->sc_xmtmap[i] != NULL)
+                       bus_dmamap_destroy(sc->sc_dmat, sc->sc_xmtmap[i]);
        }
 }
 
@@ -452,7 +452,7 @@
        struct qe_cdata *qc = sc->sc_qedata;
        paddr_t buffer;
        struct mbuf *m, *m0;
-       int idx, len, s, i, totlen, buflen, error;
+       int idx, len, s, i, totlen, buflen;
        short orword, csr;
 
        if ((QE_RCSR(QE_CSR_CSR) & QE_RCV_ENABLE) == 0)
@@ -502,7 +502,7 @@
                        if (m0) {
                                if (m0->m_len == 0)
                                        continue;
-                               error = bus_dmamap_load(sc->sc_dmat,
+                               bus_dmamap_load(sc->sc_dmat,
                                    sc->sc_xmtmap[idx], mtod(m0, void *),
                                    m0->m_len, 0, 0);
                                buffer = sc->sc_xmtmap[idx]->dm_segs[0].ds_addr;



Home | Main Index | Thread Index | Old Index