From 889ce9c91ecabb40f079111b22124560c55be4e6 Mon Sep 17 00:00:00 2001 From: Ryan Salsamendi Date: Fri, 30 Jun 2017 17:45:14 -0700 Subject: southbridge/intel/lynxpoint: Fix undefined behavior Fixes report found by undefined behavior sanitizer. Dereferencing a pointer that is not aligned to the size of access is undefined behavior. Change-Id: Ia3c95e36e8b7f88ed69d5339e299c40934cb87da Signed-off-by: Ryan Salsamendi Reviewed-on: https://review.coreboot.org/20446 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Paul Menzel --- src/southbridge/intel/lynxpoint/lpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/southbridge/intel') diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index 6c4acd8c04..37cd94b662 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -277,9 +277,9 @@ static void pch_power_options(device_t dev) reg32 |= (1 << 4)|(1 << 5)|(1 << 0); RCBA32(0x3310) = reg32; - reg32 = RCBA32(0x3f02); - reg32 &= ~0xf; - RCBA32(0x3f02) = reg32; + reg16 = RCBA16(0x3f02); + reg16 &= ~0xf; + RCBA16(0x3f02) = reg16; } static void pch_rtc_init(struct device *dev) -- cgit v1.2.3