aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorTim Huang <[email protected]>2024-04-26 00:43:30 +0000
committerAlex Deucher <[email protected]>2024-04-30 14:04:15 +0000
commit0fa4c25db8b791f79bc0d5a0cd58aff9ad85186b (patch)
treee024060166ed22a19df841f6d95e0db38c955155 /drivers/gpu/drm/amd/amdgpu
parentdrm/amd/pm: fix the Out-of-bounds read warning (diff)
downloadkernel-0fa4c25db8b791f79bc0d5a0cd58aff9ad85186b.tar.gz
kernel-0fa4c25db8b791f79bc0d5a0cd58aff9ad85186b.zip
drm/amdgpu: fix uninitialized scalar variable warning
Clear warning that field bp is uninitialized when calling amdgpu_virt_ras_add_bps. Signed-off-by: Tim Huang <[email protected]> Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 54ab51a4ada7..b5fc0e1ad435 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -395,6 +395,8 @@ static void amdgpu_virt_add_bad_page(struct amdgpu_device *adev,
else
vram_usage_va = adev->mman.drv_vram_usage_va;
+ memset(&bp, 0, sizeof(bp));
+
if (bp_block_size) {
bp_cnt = bp_block_size / sizeof(uint64_t);
for (bp_idx = 0; bp_idx < bp_cnt; bp_idx++) {