Skip to content

Commit

Permalink
net: xfrm: Fix end of loop tests for list_for_each_entry
Browse files Browse the repository at this point in the history
[ Upstream commit 480e93e ]

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 <harshvardhan.jha@oracle.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Harshvardhan Jha authored and Sasha Levin committed Aug 26, 2021
1 parent 1718285 commit 38df50a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_ipcomp.c
Expand Up @@ -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;
Expand Down

0 comments on commit 38df50a

Please sign in to comment.