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 Set IVAR (Interrupt Vector Allocation Regi...



details:   https://anonhg.NetBSD.org/src/rev/c5b3ea6bc88a
branches:  trunk
changeset: 1000479:c5b3ea6bc88a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jul 26 04:08:39 2019 +0000

description:
Set IVAR (Interrupt Vector Allocation Register) correctly for 82598 in
ixgbe_set_ivar(). Found by KUBSan.

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r 1fed0010a91c -r c5b3ea6bc88a sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Jul 26 03:28:13 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Jul 26 04:08:39 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.197 2019/07/26 03:28:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.198 2019/07/26 04:08:39 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -4188,8 +4188,8 @@
                        entry += (type * 64);
                index = (entry >> 2) & 0x1F;
                ivar = IXGBE_READ_REG(hw, IXGBE_IVAR(index));
-               ivar &= ~(0xFF << (8 * (entry & 0x3)));
-               ivar |= (vector << (8 * (entry & 0x3)));
+               ivar &= ~(0xffUL << (8 * (entry & 0x3)));
+               ivar |= ((u32)vector << (8 * (entry & 0x3)));
                IXGBE_WRITE_REG(&adapter->hw, IXGBE_IVAR(index), ivar);
                break;
        case ixgbe_mac_82599EB:



Home | Main Index | Thread Index | Old Index