summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2019-07-25 14:31:35 +0000
committermsaitoh <msaitoh@NetBSD.org>2019-07-25 14:31:35 +0000
commitef8dd2007d11fc152d80f802c3954c5038d73fc9 (patch)
tree64ae110ed8a4598a90f93b6da028f796720f1b22 /sys/dev/ic
parent00f87f9f4e81dde57d948368af621ff0c9a242e1 (diff)
Avoid undefined behavior. Found by KUBSan.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/rtwnreg.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/ic/rtwnreg.h b/sys/dev/ic/rtwnreg.h
index eae63bb1383..dad243e83ce 100644
--- a/sys/dev/ic/rtwnreg.h
+++ b/sys/dev/ic/rtwnreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rtwnreg.h,v 1.1 2018/06/29 04:02:10 thorpej Exp $ */
+/* $NetBSD: rtwnreg.h,v 1.2 2019/07/25 14:31:35 msaitoh Exp $ */
/* $OpenBSD: r92creg.h,v 1.16 2017/09/22 13:41:56 kevlo Exp $ */
/*-
@@ -1031,7 +1031,8 @@
/* Macros to access unaligned little-endian memory. */
#define LE_READ_2(x) ((x)[0] | ((x)[1] << 8))
-#define LE_READ_4(x) ((x)[0] | ((x)[1] << 8) | ((x)[2] << 16) | ((x)[3] << 24))
+#define LE_READ_4(x) ((x)[0] | ((x)[1] << 8) | ((x)[2] << 16) | \
+ ((uint32_t)((x)[3]) << 24))
/*
* Macros to access subfields in registers.