diff options
author | Ryan Salsamendi <rsalsamendi@hotmail.com> | 2017-06-30 17:45:14 -0700 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-07-03 10:31:58 +0000 |
commit | 889ce9c91ecabb40f079111b22124560c55be4e6 (patch) | |
tree | 4ae476acfc9ce4372e2b82853c608f2f431172cf /src | |
parent | d9d351d2512af0804f00f0561b66ab18ba879dce (diff) |
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 <rsalsamendi@hotmail.com>
Reviewed-on: https://review.coreboot.org/20446
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/southbridge/intel/lynxpoint/lpc.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) |