Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/pci Fix missing NULL check after softint_establ...



details:   https://anonhg.NetBSD.org/src/rev/ee6c970c59d6
branches:  trunk
changeset: 458076:ee6c970c59d6
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Mon Jul 29 09:45:16 2019 +0000

description:
Fix missing NULL check after softint_establish().

diffstat:

 sys/arch/x86/pci/if_vmx.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 7286994b5c1d -r ee6c970c59d6 sys/arch/x86/pci/if_vmx.c
--- a/sys/arch/x86/pci/if_vmx.c Mon Jul 29 09:42:17 2019 +0000
+++ b/sys/arch/x86/pci/if_vmx.c Mon Jul 29 09:45:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vmx.c,v 1.41 2019/07/29 02:20:59 knakahara Exp $    */
+/*     $NetBSD: if_vmx.c,v 1.42 2019/07/29 09:45:16 knakahara Exp $    */
 /*     $OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $        */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.41 2019/07/29 02:20:59 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.42 2019/07/29 09:45:16 knakahara Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -1046,6 +1046,12 @@
 
        txq->vxtxq_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
            vmxnet3_deferred_transmit, txq);
+       if (txq->vxtxq_si == NULL) {
+               mutex_obj_free(txq->vxtxq_mtx);
+               aprint_error_dev(sc->vmx_dev,
+                   "softint_establish for vxtxq_si failed\n");
+               return ENOMEM;
+       }
 
        txr->vxtxr_ndesc = sc->vmx_ntxdescs;
        txr->vxtxr_txbuf = kmem_zalloc(txr->vxtxr_ndesc *



Home | Main Index | Thread Index | Old Index