aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
diff options
context:
space:
mode:
authorSunil Khatri <[email protected]>2025-07-09 07:16:18 +0000
committerChristian König <[email protected]>2025-07-09 08:15:30 +0000
commit03d5236014a5d298c26b2ca80e5834aa844574b3 (patch)
treed2e91b7c92cd5f31f82d89c77771f02835e536ca /drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
parentdrm/amdgpu: fix MQD debugfs undefined symbol when DEBUG_FS=n (diff)
downloadkernel-03d5236014a5d298c26b2ca80e5834aa844574b3.tar.gz
kernel-03d5236014a5d298c26b2ca80e5834aa844574b3.zip
drm/amdgpu: fix the logic to validate fpriv and root bo
Fix the smatch warning, smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:2146 amdgpu_pt_info_read() error: we previously assumed 'fpriv' could be null (see line 2146) "if (!fpriv && !fpriv->vm.root.bo)", It has to be an OR condition rather than an AND which makes an NULL dereference in case fpriv is NULL. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Sunil Khatri <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 2353455d4aff..0e6e2e2acf5b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -2143,7 +2143,7 @@ static int amdgpu_pt_info_read(struct seq_file *m, void *unused)
return -EINVAL;
fpriv = file->driver_priv;
- if (!fpriv && !fpriv->vm.root.bo)
+ if (!fpriv || !fpriv->vm.root.bo)
return -ENODEV;
root_bo = amdgpu_bo_ref(fpriv->vm.root.bo);