[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250325100908.68325-1-a.vatoropin@crpt.ru>
Date: Tue, 25 Mar 2025 10:09:15 +0000
From: Ваторопин Андрей
<a.vatoropin@...t.ru>
To: Felix Kuehling <Felix.Kuehling@....com>
CC: Ваторопин Андрей
<a.vatoropin@...t.ru>, Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>, David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
"amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>
Subject: [PATCH] drm/amdkfd: Remove the redundant NULL check for the 'svms'
object
From: Andrey Vatoropin <a.vatoropin@...t.ru>
Static analysis shows that pointer "svms" cannot be NULL because it points
to the object "struct svm_range_list".
Remove the extra NULL check. It is meaningless and harms the readability
of the code.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Vatoropin <a.vatoropin@...t.ru>
---
drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index bd3e20d981e0..9f0c6b623176 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -4089,8 +4089,6 @@ int svm_range_get_info(struct kfd_process *p, uint32_t *num_svm_ranges,
*svm_priv_data_size = 0;
svms = &p->svms;
- if (!svms)
- return -EINVAL;
mutex_lock(&svms->lock);
list_for_each_entry(prange, &svms->list, list) {
@@ -4149,8 +4147,6 @@ int kfd_criu_checkpoint_svm(struct kfd_process *p,
struct mm_struct *mm;
svms = &p->svms;
- if (!svms)
- return -EINVAL;
mm = get_task_mm(p->lead_thread);
if (!mm) {
--
2.43.0
Powered by blists - more mailing lists