Re: [PATCH] drm/amdgpu: remove redundant NULL check in amdgpu_cs_vm_handling
From: Alex Deucher
Date: Wed Sep 09 2026 - 14:35:57 EST
Applied. Thanks!
On Wed, Sep 9, 2026 at 9:05 AM Jiangshan Yi <yijiangshan@xxxxxxxxxx> wrote:
>
> bo_va is assigned from fpriv->csa_va, which is already verified to be
> non-NULL by the surrounding if statement. The inner NULL check can
> therefore never trigger and is dead code, so remove it.
>
> Signed-off-by: Jiangshan Yi <yijiangshan@xxxxxxxxxx>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 03b41f803520..c978f042ae1f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1146,8 +1146,6 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
>
> if (fpriv->csa_va) {
> bo_va = fpriv->csa_va;
> - if (!bo_va)
> - return -ENOMEM;
> r = amdgpu_vm_bo_update(adev, bo_va, false);
> if (r)
> return r;
> --
> 2.25.1
>