diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2019-08-05 10:09:35 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2019-08-05 10:09:35 +0000 |
| commit | ebc51ba0f02ced4c89c1774591ae3a3fa5b4d994 (patch) | |
| tree | ab0422128368bcf29b0f00762a3aba06f05d1400 /sys/dev | |
| parent | c065ca505d6ea9db9a805f0e383448c32f45a3c2 (diff) | |
Fix undefined behavior in thinkpad_mask_init(). Found by kUBSan.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/thinkpad_acpi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/acpi/thinkpad_acpi.c b/sys/dev/acpi/thinkpad_acpi.c index e66fac894cf..4a9f1e2a3b8 100644 --- a/sys/dev/acpi/thinkpad_acpi.c +++ b/sys/dev/acpi/thinkpad_acpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: thinkpad_acpi.c,v 1.46 2016/04/03 10:36:00 mlelstv Exp $ */ +/* $NetBSD: thinkpad_acpi.c,v 1.47 2019/08/05 10:09:35 msaitoh Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.46 2016/04/03 10:36:00 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.47 2019/08/05 10:09:35 msaitoh Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -565,7 +565,7 @@ thinkpad_mask_init(thinkpad_softc_t *sc, uint32_t mask) for (i = 0; i < 32; i++) { param[0].Integer.Value = i + 1; - param[1].Integer.Value = (((1 << i) & mask) != 0); + param[1].Integer.Value = ((__BIT(i) & mask) != 0); rv = AcpiEvaluateObject(sc->sc_node->ad_handle, "MHKM", ¶ms, NULL); |
