RE: [PATCH 01/22] drm/amdgpu: fix dereference after null check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - General]

Reviewed-by: Tim Huang <Tim.Huang@xxxxxxx>



> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Jesse
> Zhang
> Sent: Friday, May 10, 2024 10:50 AM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian
> <Christian.Koenig@xxxxxxx>; Huang, Tim <Tim.Huang@xxxxxxx>; Zhang,
> Jesse(Jie) <Jesse.Zhang@xxxxxxx>; Zhang, Jesse(Jie)
> <Jesse.Zhang@xxxxxxx>
> Subject: [PATCH 01/22] drm/amdgpu: fix dereference after null check
>
> check the pointer hive before use.
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang@xxxxxxx>
> ---
>  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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux