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>
This commit is contained in:
Ryan Salsamendi 2017-06-30 17:45:14 -07:00 committed by Nico Huber
parent d9d351d251
commit 889ce9c91e
1 changed files with 3 additions and 3 deletions

View File

@ -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)