From nobody Fri Dec 19 00:41:33 2025 Received: from mail.crpt.ru (mail1.crpt.ru [91.236.205.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CC861A2389 for ; Tue, 25 Mar 2025 10:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.236.205.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742897380; cv=none; b=GPwsh3DW8mJOJSmKNgBFv5QxFdlznHBbVrApxKVi62X9+ZvAgJyI+TMID4bjdv2tuvPAnoifA5K5F3oaXNUktESGlwMB1u1qWumHLLenVx2/9BZzRRGoXWu36PlLlRtRTf0txegTvI/gy9w8xKxotY1o8TwbZYYcqxAQwF0dZvo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742897380; c=relaxed/simple; bh=S8ZTcQtvS2V8JjQOpgLS5GBUFk1XIB89xcUDwVmVR60=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=VFBz1JjNBFeF3ub0fkJCaZ5cximx3323KcIq03eUbif38jVYfLlpBgZwWO02/Ti3fmt84+ataVw7xky0dhfgGuRlR1PPGKJO/IESdGNPDqot2ouryfLZ37Eebfbn+3QtxP2jGgz6bKhxFVzudHN+wLnnJQcAv5I5a9eHSiw5Jo0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=crpt.ru; spf=pass smtp.mailfrom=crpt.ru; dkim=pass (2048-bit key) header.d=crpt.ru header.i=@crpt.ru header.b=RjGeU7e1; arc=none smtp.client-ip=91.236.205.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=crpt.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crpt.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=crpt.ru header.i=@crpt.ru header.b="RjGeU7e1" Received: from mail.crpt.ru ([192.168.60.4]) by mail.crpt.ru with ESMTP id 52PA9FXR017359-52PA9FXT017359 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=OK); Tue, 25 Mar 2025 13:09:15 +0300 Received: from EX2.crpt.local (192.168.60.4) by ex2.crpt.local (192.168.60.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Tue, 25 Mar 2025 13:09:16 +0300 Received: from EX2.crpt.local ([192.168.60.4]) by EX2.crpt.local ([192.168.60.4]) with mapi id 15.01.2507.044; Tue, 25 Mar 2025 13:09:16 +0300 From: =?utf-8?B?0JLQsNGC0L7RgNC+0L/QuNC9INCQ0L3QtNGA0LXQuQ==?= To: Felix Kuehling CC: =?utf-8?B?0JLQsNGC0L7RgNC+0L/QuNC9INCQ0L3QtNGA0LXQuQ==?= , Alex Deucher , =?utf-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?= , David Airlie , Simona Vetter , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" Subject: [PATCH] drm/amdkfd: Remove the redundant NULL check for the 'svms' object Thread-Topic: [PATCH] drm/amdkfd: Remove the redundant NULL check for the 'svms' object Thread-Index: AQHbnW33CeLhAJikwUeO11Tuz1gnSA== Date: Tue, 25 Mar 2025 10:09:15 +0000 Message-ID: <20250325100908.68325-1-a.vatoropin@crpt.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-kse-serverinfo: EX2.crpt.local, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 3/24/2025 10:00:00 PM x-kse-attachment-filter-triggered-rules: Clean x-kse-attachment-filter-triggered-filters: Clean x-kse-bulkmessagesfiltering-scan-result: protection disabled Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-FEAS-Client-IP: 192.168.60.4 X-FE-Policy-ID: 2:4:0:SYSTEM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; d=crpt.ru; s=crpt.ru; c=relaxed/relaxed; h=from:to:cc:subject:date:message-id:content-type:mime-version; bh=S8ZTcQtvS2V8JjQOpgLS5GBUFk1XIB89xcUDwVmVR60=; b=RjGeU7e15VmA3QoUPYBidpFwzm6fOZoMgccWwzeAXxPH+LRrdeMZmoIRzoGbqCZI7KIsAeuw7UqK R6c42I69wLyOZzeSXFiJuiYZRaIHcr+DiO0mxHVZnpzS0mMAf30T0C2MqjxFJ+4/HwQEc0HLJpKb OLBoPjiXkNy0zd4Wr5XuKGupkg3gpy1Tk5rvADmy3iuMmYLr08c2NoRiqossJLU2uEeHQ/n9qFfk WRn7hhzvisIvj/499sk8H2vSbh1friBeesyI3ubP+3DW0pJdqGnFKSebR4xHemCyaZguosOnstPi JKZN0yD1Btp5ReqwuQSquTWOdJSPBd0uOpiaqg== From: Andrey Vatoropin 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 --- 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/amd= kfd/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 =3D 0; =20 svms =3D &p->svms; - if (!svms) - return -EINVAL; =20 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; =20 svms =3D &p->svms; - if (!svms) - return -EINVAL; =20 mm =3D get_task_mm(p->lead_thread); if (!mm) { --=20 2.43.0