diff options
author | Jacob Garber <jgarber1@ualberta.ca> | 2019-07-23 15:30:45 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-07-25 16:04:27 +0000 |
commit | 9777048e9209c1f59d225427b28513984216fd01 (patch) | |
tree | 27e13f0a2d7a126c4969c981e886f6b4accd2bac /src/mainboard | |
parent | bd00fb13663560fa1a204ae8d324a603370e19ff (diff) |
soc/nvidia/tegra210: Prevent unintended sign extension
The perennial problem with u16 << 16 strikes again - the u16 is
implicitly promoted to an int before the shift, which will then become
negative if the highest bit of the u16 was set. Normally this isn't much
of a problem, but in this case tegra_dsi_writel() expects a 64 bit integer
for that argument, and so it will be sign-extended to a very large
unsigned integer if it is negative. Cast bytes to a u32 beforehand to
prevent the implicit promotion and thus this problem.
Change-Id: Iaf0fb1040ccafafde0093e9bb192c802b86cb2ac
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Found-by: Coverity CID 1294800
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34529
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard')
0 files changed, 0 insertions, 0 deletions