Ryan Salsamendi has uploaded this change for review.

View Change

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>
---
M src/southbridge/intel/lynxpoint/lpc.c
1 file changed, 3 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/20446/1
diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c
index 6c4acd8..37cd94b 100644
--- a/src/southbridge/intel/lynxpoint/lpc.c
+++ b/src/southbridge/intel/lynxpoint/lpc.c
@@ -277,9 +277,9 @@
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)

To view, visit change 20446. To unsubscribe, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3c95e36e8b7f88ed69d5339e299c40934cb87da
Gerrit-Change-Number: 20446
Gerrit-PatchSet: 1
Gerrit-Owner: Ryan Salsamendi <rsalsamendi@hotmail.com>