Source-Changes-HG archive

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

[src/netbsd-7-1]: src/sys/dev/pci Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/aaccf37dbd87
branches:  netbsd-7-1
changeset: 800765:aaccf37dbd87
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Aug 12 03:23:45 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1469):
        sys/dev/pci/if_ipw.c: revision 1.65
Null out sbuf->m on failure to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sbuf->map out of paranoia.

diffstat:

 sys/dev/pci/if_ipw.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r d8c9daf6a635 -r aaccf37dbd87 sys/dev/pci/if_ipw.c
--- a/sys/dev/pci/if_ipw.c      Fri Aug 11 15:32:45 2017 +0000
+++ b/sys/dev/pci/if_ipw.c      Sat Aug 12 03:23:45 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $     */
+/*     $NetBSD: if_ipw.c,v 1.57.12.1 2017/08/12 03:23:45 snj Exp $     */
 /*     FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp         */
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57.12.1 2017/08/12 03:23:45 snj Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -592,6 +592,7 @@
                MCLGET(sbuf->m, M_DONTWAIT);
                if (!(sbuf->m->m_flags & M_EXT)) {
                        m_freem(sbuf->m);
+                       sbuf->m = NULL;
                        aprint_error_dev(sc->sc_dev, "could not allocate rx mbuf cluster\n");
                        error = ENOMEM;
                        goto fail;
@@ -604,6 +605,7 @@
                if (error != 0) {
                        aprint_error_dev(sc->sc_dev, "could not create rxbuf dma map\n");
                        m_freem(sbuf->m);
+                       sbuf->m = NULL;
                        goto fail;
                }
 
@@ -611,7 +613,9 @@
                    sbuf->m, BUS_DMA_READ | BUS_DMA_NOWAIT);
                if (error != 0) {
                        bus_dmamap_destroy(sc->sc_dmat, sbuf->map);
+                       sbuf->map = NULL;
                        m_freem(sbuf->m);
+                       sbuf->m = NULL;
                        aprint_error_dev(sc->sc_dev, "could not map rxbuf dma memory\n");
                        goto fail;
                }



Home | Main Index | Thread Index | Old Index