[AMD Official Use Only - General]

Reviewed-by: Tim Huang <[email protected]>



> -----Original Message-----
> From: amd-gfx <[email protected]> On Behalf Of Jesse
> Zhang
> Sent: Friday, May 10, 2024 10:50 AM
> To: [email protected]
> Cc: Deucher, Alexander <[email protected]>; Koenig, Christian
> <[email protected]>; Huang, Tim <[email protected]>; Zhang,
> Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie)
> <[email protected]>
> Subject: [PATCH 01/22] drm/amdgpu: fix dereference after null check
>
> check the pointer hive before use.
>
> Signed-off-by: Jesse Zhang <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 77f6fd50002a..00fe3c2d5431 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -5725,7 +5725,7 @@ int amdgpu_device_gpu_recover(struct
> amdgpu_device *adev,
>        * to put adev in the 1st position.
>        */
>       INIT_LIST_HEAD(&device_list);
> -     if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes >
> 1)) {
> +     if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes >
> 1) && hive) {
>               list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head)
> {
>                       list_add_tail(&tmp_adev->reset_list, &device_list);
>                       if (adev->shutdown)
> --
> 2.25.1

Reply via email to