[PATCH v1 1/1] drm/amdgpu: fix a smatch static checker warning in amdgpu_pci_slot_reset

Zhou1, Tao Tao.Zhou1 at amd.com
Thu Apr 10 02:02:25 UTC 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Ce Sun
> Sent: Wednesday, April 9, 2025 8:10 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: dan.carpenter at linaro.org; Sun, Ce(Overlord) <Ce.Sun at amd.com>
> Subject: [PATCH v1 1/1] drm/amdgpu: fix a smatch static checker warning in
> amdgpu_pci_slot_reset
>
> Fixes smatch warning:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:6820 amdgpu_pci_slot_reset()
> warn: iterator used outside loop: 'tmp_adev'
>
> Fixes: 8ba904f54148 ("drm/amdgpu: Multi-GPU DPC recovery support")
>
> Signed-off-by: Ce Sun <cesun102 at amd.com>
> ---
>  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 60269fba5745..eb0589a09a27 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -6846,7 +6846,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev
> *pdev)
>               dev_info(adev->dev, "PCIe error recovery succeeded\n");
>       } else {
>               dev_err(adev->dev, "PCIe error recovery failed, err:%d\n", r);
> -             if (tmp_adev) {
> +             if (hive) {
>                       list_for_each_entry(tmp_adev, &device_list, reset_list)
>                               amdgpu_device_unset_mp1_state(tmp_adev);
>                       amdgpu_device_unlock_reset_domain(adev->reset_domain);
> --
> 2.34.1



More information about the amd-gfx mailing list