[PATCH v2] drm/amdgpu: remove redundant null check

2022-03-02 Thread Weiguo Li
Remove the redundant null check since the caller ensures that 'ctx' is never NULL. Signed-off-by: Weiguo Li --- v2: * take Christian and Alex's suggestion --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdg

[PATCH] drm/amdgpu: fix potential null dereference

2022-03-02 Thread Weiguo Li
"ctx" is dereferenced but null checked later. Swap their positions to avoid potential null dereference. Found using a Coccinelle script: https://coccinelle.gitlabpages.inria.fr/website/rules/mini_null_ref.cocci Signed-off-by: Weiguo Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6

[PATCH] drm/amdgpu: fix potential null dereference

2022-03-01 Thread Weiguo Li
"ctx" is dereferenced but null checked later. Swap their positions to avoid potential null dereference. Found using a Coccinelle script: https://coccinelle.gitlabpages.inria.fr/website/rules/mini_null_ref.cocci Signed-off-by: Weiguo Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6