[PATCH] drm/amdkfd: Uninitialized pointer read

Kasiviswanathan, Harish Harish.Kasiviswanathan at amd.com
Mon Dec 9 18:52:22 UTC 2024


[Public]

Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>


-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Andrew Martin
Sent: Friday, December 6, 2024 3:07 PM
To: amd-gfx at lists.freedesktop.org
Cc: Kuehling, Felix <Felix.Kuehling at amd.com>; Tudor, Alexandru <Alexandru.Tudor at amd.com>; Martin, Andrew <Andrew.Martin at amd.com>; Martin, Andrew <Andrew.Martin at amd.com>
Subject: [PATCH] drm/amdkfd: Uninitialized pointer read

This a pointer that is being passed into other functions, so it is best to
initialize it to NULL prior.

Signed-off-by: Andrew Martin <Andrew.Martin at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 52c6c5e9d264..ceb9fb475ef1 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -1777,7 +1777,7 @@ static void kfd_fill_cache_non_crat_info(struct kfd_topology_device *dev, struct
        struct amdgpu_cu_info *cu_info = &kdev->adev->gfx.cu_info;
        struct amdgpu_gfx_config *gfx_info = &kdev->adev->gfx.config;
        int gpu_processor_id;
-       struct kfd_cache_properties *props_ext;
+       struct kfd_cache_properties *props_ext = NULL;
        int num_of_entries = 0;
        int num_of_cache_types = 0;
        struct kfd_gpu_cache_info cache_info[KFD_MAX_CACHE_TYPES];
--
2.43.0



More information about the amd-gfx mailing list