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/f61314ea8d4e
branches:  trunk
changeset: 1000449:f61314ea8d4e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Jul 25 05:58:25 2019 +0000

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

diffstat:

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

diffs (20 lines):

diff -r cb8af0bfef97 -r f61314ea8d4e sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Thu Jul 25 04:25:40 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Thu Jul 25 05:58:25 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.120 2019/07/17 03:26:24 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.121 2019/07/25 05:58:25 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -2190,8 +2190,8 @@
        } else {          /* RX/TX IVARS */
                index = (16 * (entry & 1)) + (8 * type);
                ivar = IXGBE_READ_REG(hw, IXGBE_VTIVAR(entry >> 1));
-               ivar &= ~(0xFF << index);
-               ivar |= (vector << index);
+               ivar &= ~(0xffUL << index);
+               ivar |= ((u32)vector << index);
                IXGBE_WRITE_REG(hw, IXGBE_VTIVAR(entry >> 1), ivar);
        }
 } /* ixv_set_ivar */



Home | Main Index | Thread Index | Old Index