Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Zero interrupt handles upon allocation.



details:   https://anonhg.NetBSD.org/src/rev/2feb3b8ee2b8
branches:  trunk
changeset: 980583:2feb3b8ee2b8
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Tue Feb 09 15:05:49 2021 +0000

description:
Zero interrupt handles upon allocation.

Might prevent detach-time bugs.

diffstat:

 sys/dev/pci/if_iavf.c |  6 +++---
 sys/dev/pci/if_ixl.c  |  6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 69c95cfb74a9 -r 2feb3b8ee2b8 sys/dev/pci/if_iavf.c
--- a/sys/dev/pci/if_iavf.c     Tue Feb 09 14:24:14 2021 +0000
+++ b/sys/dev/pci/if_iavf.c     Tue Feb 09 15:05:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iavf.c,v 1.11 2020/12/10 04:03:00 yamaguchi Exp $   */
+/*     $NetBSD: if_iavf.c,v 1.12 2021/02/09 15:05:49 jakllsch Exp $    */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iavf.c,v 1.11 2020/12/10 04:03:00 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iavf.c,v 1.12 2021/02/09 15:05:49 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -1789,7 +1789,7 @@
                num = counts[PCI_INTR_TYPE_MSIX];
        }
 
-       sc->sc_ihs = kmem_alloc(sizeof(sc->sc_ihs[0]) * num, KM_NOSLEEP);
+       sc->sc_ihs = kmem_zalloc(sizeof(sc->sc_ihs[0]) * num, KM_NOSLEEP);
        if (sc->sc_ihs == NULL) {
                IAVF_LOG(sc, LOG_ERR,
                    "couldn't allocate memory for interrupts\n");
diff -r 69c95cfb74a9 -r 2feb3b8ee2b8 sys/dev/pci/if_ixl.c
--- a/sys/dev/pci/if_ixl.c      Tue Feb 09 14:24:14 2021 +0000
+++ b/sys/dev/pci/if_ixl.c      Tue Feb 09 15:05:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ixl.c,v 1.75 2020/09/08 10:05:47 yamaguchi Exp $    */
+/*     $NetBSD: if_ixl.c,v 1.76 2021/02/09 15:05:49 jakllsch Exp $     */
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.75 2020/09/08 10:05:47 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.76 2021/02/09 15:05:49 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -5925,7 +5925,7 @@
                            PCI_INTR_MPSAFE, true);
                }
 
-               sc->sc_ihs = kmem_alloc(sizeof(sc->sc_ihs[0]) * sc->sc_nintrs,
+               sc->sc_ihs = kmem_zalloc(sizeof(sc->sc_ihs[0]) * sc->sc_nintrs,
                    KM_SLEEP);
 
                if (intr_type == PCI_INTR_TYPE_MSIX) {



Home | Main Index | Thread Index | Old Index