summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineering.com>2018-06-17 23:59:51 -0500
committerTimothy Pearson <tpearson@raptorengineering.com>2018-06-23 16:29:47 -0500
commit578e2d761554130f7c6abfe821c2509912a00ac6 (patch)
treed5cfc6325bf834b06afc8c248976ae2290c9af14
parentb29e05ceb186923224e8a4227444e4aa8cb59d6a (diff)
downloadop-kernel-dev-578e2d761554130f7c6abfe821c2509912a00ac6.zip
op-kernel-dev-578e2d761554130f7c6abfe821c2509912a00ac6.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 d644a9b..a9c386f 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