Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2897856pxb; Tue, 24 Aug 2021 10:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy+jGg2B/TPFEhXX/FvThsJFvRXLVRcyAqnLgdGFe7Q/xB9JL3es7ZNJWTDwKckJBbszf2 X-Received: by 2002:a92:611:: with SMTP id x17mr26763135ilg.41.1629824851629; Tue, 24 Aug 2021 10:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824851; cv=none; d=google.com; s=arc-20160816; b=BxH/VDVTif+Gd1G9paIZp4so8ZdCddHZacP7PJ5NLCIjrlCPYPF2dMX/qFgUVIkEcr 6KMUgvuBqm/avICL2QHrvLEEjsW1wuWAzTiTAEr8j7d8KntQFhDl/7tpjk5RMcnoOHvX 7PNuO6xfqWZu//zr2FfHw3+bSDcy0mOg8khcxd2aeAAEV715IuGL8OUHsfOKQNkG8SGB Q4NWGBtSe0E0QOrsqSdB5NpArKMaZyyOPTHL4qvymNt4TqBR8iL+5QbN32k8LR8y0PDj d+COEX5DKcQA9tt36swxhljBX9wz0C4qf3W5IiM6np6XA13hBnmbSZiEzWIpJlMKge00 SEnw== 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=LsE4l7nR8ICRVGDyZ5m2NtFGr5ALhv3G2ql/jMQhkpo=; b=KHrImMGIKLB6C7YDa70YSCY1tohvVF+GSHNt9IZxV38+yjtliqbymTcfiEeHtS7vWw uyJtYqsqT6aXvYOueR6ayrno8QTI8PDEOpY3iQR1IMeY476D4n2bSq8YqTdeAHrcuDvy DnmQah/IBZQqnP89uDXQ/JA9JNDdHxIrj1/2HoglcT89Qo55GGwFnfrPqWu+rckwunZQ iU7jYl5QiBBZrFd1RUuZi3nwtLI6JAwpmDKq9I5I9/tGjfEPdJQ8HwWmdrUfU7pNsQHw M7WXMX+iNNPrxxzJI5hkb/7x/WnUd1pStDNSSMf4MirCDngdadU5b0lvQ/gbV/vF2JFo AU/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YV9YvjIA; 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 f16si17085045ils.116.2021.08.24.10.07.16; Tue, 24 Aug 2021 10:07:31 -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=YV9YvjIA; 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 S238873AbhHXRHO (ORCPT + 99 others); Tue, 24 Aug 2021 13:07:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:46032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239636AbhHXREb (ORCPT ); Tue, 24 Aug 2021 13:04:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E84976141B; Tue, 24 Aug 2021 16:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824369; bh=iD9D/k5aNOEcdSZegmyuiigYvh4NINWH+mB9toJlgiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YV9YvjIAywGKokGIA121x1NCOWo6rvopUmDXxtazc3KfIU9NiswawowSbXxsTnBsN xmlB9S/oUq+tlhy7sM2yEYCWmdclg2cHtWg7xnEi3EjpAVHw+jlaLbSPX7kvHCOd2x +mfze9u3u37sQtsO+b5B49LV+dLHhlz1S33/FY1jZxAOn+riV+l6yKvmJjspY0ZQ6i G1S3im4cYCjovIqtjcZoKXxdFJUQaEQqHvg/layegIqr/8BQQVsvmz0BJkxDpagNz+ W2EVtJkoSozhPFsRbzx/29c9UCvIeFNISgeYMGJPL0PqxAGMaMgiXvopocHdp3YMxD vxM+94WdU3gcA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Harshvardhan Jha , Steffen Klassert , Sasha Levin Subject: [PATCH 5.10 19/98] net: xfrm: Fix end of loop tests for list_for_each_entry Date: Tue, 24 Aug 2021 12:57:49 -0400 Message-Id: <20210824165908.709932-20-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165908.709932-1-sashal@kernel.org> References: <20210824165908.709932-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.61-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.61-rc1 X-KernelTest-Deadline: 2021-08-26T16:58+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harshvardhan Jha [ Upstream commit 480e93e12aa04d857f7cc2e6fcec181c0d690404 ] The list_for_each_entry() iterator, "pos" in this code, can never be NULL so the warning will never be printed. Signed-off-by: Harshvardhan Jha Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/xfrm/xfrm_ipcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 4d422447aadc..0814320472f1 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -250,7 +250,7 @@ static void ipcomp_free_tfms(struct crypto_comp * __percpu *tfms) break; } - WARN_ON(!pos); + WARN_ON(list_entry_is_head(pos, &ipcomp_tfms_list, list)); if (--pos->users) return; -- 2.30.2