Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/ixgbe Fix panic or hangup when "sysctl -w hw.ixg...



details:   https://anonhg.NetBSD.org/src/rev/c47f36c9ced2
branches:  trunk
changeset: 322720:c47f36c9ced2
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon May 14 09:21:36 2018 +0000

description:
Fix panic or hangup when "sysctl -w hw.ixgN.debug=1".

XXX pullup-8

diffstat:

 sys/dev/pci/ixgbe/ixv.c |  11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diffs (34 lines):

diff -r 7a0eda0d8a2c -r c47f36c9ced2 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Mon May 14 06:52:33 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Mon May 14 09:21:36 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.96 2018/05/08 09:45:54 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.97 2018/05/14 09:21:36 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -2639,21 +2639,18 @@
 static int
 ixv_sysctl_debug(SYSCTLFN_ARGS)
 {
-       struct sysctlnode node;
-       struct adapter *adapter;
+       struct sysctlnode node = *rnode;
+       struct adapter *adapter = (struct adapter *)node.sysctl_data;
        int            error, result;
 
-       node = *rnode;
        node.sysctl_data = &result;
        error = sysctl_lookup(SYSCTLFN_CALL(&node));
 
        if (error || newp == NULL)
                return error;
 
-       if (result == 1) {
-               adapter = (struct adapter *)node.sysctl_data;
+       if (result == 1)
                ixv_print_debug_info(adapter);
-       }
 
        return 0;
 } /* ixv_sysctl_debug */



Home | Main Index | Thread Index | Old Index