aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMa Jun <[email protected]>2022-11-06 20:34:27 +0800
committerAlex Deucher <[email protected]>2022-11-09 17:41:41 -0500
commit4cc16d64b6cdb179a26fb389cae9dce788e88f5d (patch)
treed609197d3f8a855bafdbb9b572ad9e0b598ff9b0
parent407a5bdd5513a3617aa3f8a5c738561e157f8d83 (diff)
drm/amdkfd: Fix the memory overrun
Fix the memory overrun issue caused by wrong array size. Signed-off-by: Ma Jun <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Reported-by: coverity-bot <[email protected]> Addresses-Coverity-ID: 1527133 ("Memory - corruptions") Fixes: c0cc999f3c32e6 ("drm/amdkfd: Fix the warning of array-index-out-of-bounds") Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_crat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
index 267dd69737fa..af01ba061e1b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
@@ -1111,7 +1111,7 @@ static int kfd_parse_subtype_cache(struct crat_subtype_cache *cache,
props->cache_latency = cache->cache_latency;
memcpy(props->sibling_map, cache->sibling_map,
- sizeof(props->sibling_map));
+ CRAT_SIBLINGMAP_SIZE);
/* set the sibling_map_size as 32 for CRAT from ACPI */
props->sibling_map_size = CRAT_SIBLINGMAP_SIZE;