Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146268pxv; Fri, 9 Jul 2021 19:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyC9sWuGjcasMCCna9kiGtoj8MYtSt0bc3gLG4mMPv96kQcrwCxBCiLSMGg9sK61/etmbv X-Received: by 2002:aa7:d98d:: with SMTP id u13mr7313085eds.238.1625884154756; Fri, 09 Jul 2021 19:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884154; cv=none; d=google.com; s=arc-20160816; b=E7L/YmRrI0dBwhqW2DzQycrfZEibtwDUXu0NjtKSV9XOAiIyvYVmxOCzAQZgqoX4PU 2uX4QYKW5UnS/Jimo8+4MiwpkM5LmdbyQZX/8xGpNwNsthMwlJPPqGxlr0wWBZO1M2Sa AikHl/r1qK3uOuRt7n4W4QyFTASVakLNqYtpibJkq+ueB3C+TcIGneR6fcsjnen292Rn EDJYBXZyX7ipTbrSyynOnuHfIf04xpF2hq+qMo6WkWoJXFv6LqcjSHcyW5J3UrTUHhbz 1H1oNAkvIIR06X2/QHxwTqFnPCNxSvV9GNRn/xA00QjuLvv35Yv137SN8kJfp/0Ca0rK nHQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0TpgP6+/PxEd38PVyfD4lLa13gsdFnwKHbsvPMz+j4I=; b=JI9rx2DC0VMEk+3S20IY/32GZgJPmbzbgb6gzzVibDau2SWUnwoWvG7fCI8eZRtduo Xuznk0ubLF6QWR/S/lzEjvHJoWeWgKtQ/QtVrKkS8wQCG+2X/h5OYaMXuTIwgkgokWza AB7F9/0cPi+8IuUp7YveKlSvvdCRC9XNPtRraYNdYtLFNrY1Uqy0m7StJ3ADAR2iQjw2 HE5RfJMS0HYr3CQ0d5pm0WM7D4kijpp7m+NBTUKnapo36GMnje/1oshBZRGQK+fkHMVs k7Z9TyRp06jE7gk5Uls6de8rp0o3O7Ry8IRABd3kcan4duS8xUP1e8D0VW+pXiFaMwhn iGug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m3IBL7LQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si8957943ejl.468.2021.07.09.19.28.50; Fri, 09 Jul 2021 19:29:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m3IBL7LQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233911AbhGJC15 (ORCPT + 99 others); Fri, 9 Jul 2021 22:27:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbhGJC0h (ORCPT ); Fri, 9 Jul 2021 22:26:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D733A613CC; Sat, 10 Jul 2021 02:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883828; bh=KVl5Z7EL1bfUcpunYKuwJFM9lGykpGF8c+Qa7itN/4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3IBL7LQDkfEtTcl0j/y1DlvRo16X87VgnXtp3EgxAthxiig1jTnNyJ2V1KNWKaR0 OZ7HJG4A+8v6luC8iwtsdmRnEQH24tQrPpcrfnStxOyE8ZclzKqbf387tj04t1OuJg frLatAmhBwDYvJygGsMJqmjZGGei0P3skfL3om1tXr0QKRDLY4u+O38uc4v/3BzU4A HniEA/GtbsmmsHIJ4miqkFtC29e/d01sICikWIbd5NpDVVRecWe3u8D32tdyOJ0FV3 sqfRDe1aqpAIO6LDCM55SnlmxWk7HYG6wKHwq0NsVoXpTHzdWe07y+r0qF+lRvCNf/ yvXukaOGkZK9w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Koby Elbaz , Oded Gabbay , Sasha Levin Subject: [PATCH AUTOSEL 5.12 076/104] habanalabs: remove node from list before freeing the node Date: Fri, 9 Jul 2021 22:21:28 -0400 Message-Id: <20210710022156.3168825-76-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Koby Elbaz [ Upstream commit f5eb7bf0c487a212ebda3c1b048fc3ccabacc147 ] fix the following smatch warnings: goya_pin_memory_before_cs() warn: '&userptr->job_node' not removed from list gaudi_pin_memory_before_cs() warn: '&userptr->job_node' not removed from list Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/gaudi/gaudi.c | 1 + drivers/misc/habanalabs/goya/goya.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index a03f13aa47f8..0c6092ebbc04 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -4901,6 +4901,7 @@ static int gaudi_pin_memory_before_cs(struct hl_device *hdev, return 0; unpin_memory: + list_del(&userptr->job_node); hl_unpin_host_memory(hdev, userptr); free_userptr: kfree(userptr); diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c index ed566c52ccaa..45c9065c4b92 100644 --- a/drivers/misc/habanalabs/goya/goya.c +++ b/drivers/misc/habanalabs/goya/goya.c @@ -3249,6 +3249,7 @@ static int goya_pin_memory_before_cs(struct hl_device *hdev, return 0; unpin_memory: + list_del(&userptr->job_node); hl_unpin_host_memory(hdev, userptr); free_userptr: kfree(userptr); -- 2.30.2