Skip to content

Commit

Permalink
xfrm: Remove unnecessary NULL check in xfrm_lookup_with_ifid()
Browse files Browse the repository at this point in the history
This NULL check is unnecessary and can be removed.  It confuses
Smatch static analysis tool because it makes Smatch think that
xfrm_lookup_with_ifid() can return a mix of NULL pointers and errors so
it creates a lot of false positives.  Remove it.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
  • Loading branch information
Dan Carpenter authored and Steffen Klassert committed Mar 19, 2025
1 parent 2e460ee commit 399e0aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,7 @@ struct dst_entry *xfrm_lookup_with_ifid(struct net *net,

ok:
xfrm_pols_put(pols, drop_pols);
if (dst && dst->xfrm &&
if (dst->xfrm &&
(dst->xfrm->props.mode == XFRM_MODE_TUNNEL ||
dst->xfrm->props.mode == XFRM_MODE_IPTFS))
dst->flags |= DST_XFRM_TUNNEL;
Expand Down

0 comments on commit 399e0aa

Please sign in to comment.