summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2022-09-16 07:34:36 +0000
committermsaitoh <msaitoh@NetBSD.org>2022-09-16 07:34:36 +0000
commit4c7f2ed65fba2b19261b0d35426fe7367fcfb37b (patch)
treeddf0f457b0d4420bd455d0b9bccb7a4edccfc437 /sys/dev/usb
parent31593bb6f8bcd91db57ac1d0211e31ab7313aef2 (diff)
Use unsigned to avoid undefined behavior in ure_uno_mcast(). Found by kUBSan.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_ure.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/if_ure.c b/sys/dev/usb/if_ure.c
index 8f04d1f9d34..3f70ba3591d 100644
--- a/sys/dev/usb/if_ure.c
+++ b/sys/dev/usb/if_ure.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ure.c,v 1.57 2022/08/20 14:08:59 riastradh Exp $ */
+/* $NetBSD: if_ure.c,v 1.58 2022/09/16 07:34:36 msaitoh Exp $ */
/* $OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $ */
/*-
@@ -30,7 +30,7 @@
/* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.57 2022/08/20 14:08:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.58 2022/09/16 07:34:36 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -372,7 +372,7 @@ ure_uno_mcast(struct ifnet *ifp)
goto update;
}
h = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
- mchash[h >> 31] |= 1 << ((h >> 26) & 0x1f);
+ mchash[h >> 31] |= 1U << ((h >> 26) & 0x1f);
ETHER_NEXT_MULTI(step, enm);
}
ETHER_UNLOCK(ec);