summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineering.com>2018-06-17 23:59:51 -0500
committerroot <root@rcs-power9-talos>2018-10-27 02:51:26 -0400
commit1f0e220a0875e611e426a6b55f546254714a8ca4 (patch)
tree5c63f506689b809f1ac48240225f9da0d03cf318
parent9d8bed4d5db2e83b862d4c750e51dab3ce6d6bfc (diff)
downloadop-kernel-dev-1f0e220a0875e611e426a6b55f546254714a8ca4.zip
op-kernel-dev-1f0e220a0875e611e426a6b55f546254714a8ca4.tar.gz
Fix undefined behaviour from signed integer overflow
Caught by UBSAN Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c
index a029e47..f7e56be 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c
@@ -98,7 +98,7 @@ int smu7_copy_bytes_to_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
while (byte_count >= 4) {
/* Bytes are written into the SMC addres space with the MSB first. */
- data = src[0] * 0x1000000 + src[1] * 0x10000 + src[2] * 0x100 + src[3];
+ data = src[0] * 0x1000000U + src[1] * 0x10000U + src[2] * 0x100U + src[3];
result = smu7_set_smc_sram_address(hwmgr, addr, limit);
OpenPOWER on IntegriCloud