From: Harshvardhan Jha Date: Sun, 25 Jul 2021 17:53:55 +0000 (+0530) Subject: net: xfrm: Fix end of loop tests for list_for_each_entry X-Git-Tag: v5.14-rc5~25^2~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=480e93e12aa04d857f7cc2e6fcec181c0d690404;p=thirdparty%2Fkernel%2Flinux.git net: xfrm: Fix end of loop tests for list_for_each_entry 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 --- diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index 2e8afe078d612..cb40ff0ff28da 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -241,7 +241,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;