[PATCH 03/22] drm/amdgpu: fix the waring dereferencing hive

Huang, Tim Tim.Huang at amd.com
Fri May 10 06:20:48 UTC 2024


[AMD Official Use Only - General]

This patch is,

Reviewed-by: Tim Huang <Tim.Huang at amd.com>



> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Jesse
> Zhang
> Sent: Friday, May 10, 2024 10:50 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Huang, Tim <Tim.Huang at amd.com>; Zhang,
> Jesse(Jie) <Jesse.Zhang at amd.com>; Zhang, Jesse(Jie)
> <Jesse.Zhang at amd.com>
> Subject: [PATCH 03/22] drm/amdgpu: fix the waring dereferencing hive
>
> Check the amdgpu_hive_info *hive that maybe is NULL.
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 37820dd03cab..5a648a657dc6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -1362,6 +1362,9 @@ static void psp_xgmi_reflect_topology_info(struct
> psp_context *psp,
>       uint8_t dst_num_links = node_info.num_links;
>
>       hive = amdgpu_get_xgmi_hive(psp->adev);
> +     if (WARN_ON(!hive))
> +             return;
> +
>       list_for_each_entry(mirror_adev, &hive->device_list, gmc.xgmi.head) {
>               struct psp_xgmi_topology_info *mirror_top_info;
>               int j;
> --
> 2.25.1



More information about the amd-gfx mailing list