From: Dan Carpenter Date: Wed, 12 Mar 2025 17:21:13 +0000 (+0300) Subject: xfrm: Remove unnecessary NULL check in xfrm_lookup_with_ifid() X-Git-Tag: v6.15-rc1~160^2~15^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=399e0aae5aab30f911098a0430204e9034ff78bb;p=thirdparty%2Fkernel%2Flinux.git xfrm: Remove unnecessary NULL check in xfrm_lookup_with_ifid() 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 Reviewed-by: Michal Kubiak Signed-off-by: Steffen Klassert --- diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 6551e588fe526..30970d40a454f 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3294,7 +3294,7 @@ no_transform: 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;