]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfrm: Remove unnecessary NULL check in xfrm_lookup_with_ifid()
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 12 Mar 2025 17:21:13 +0000 (20:21 +0300)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 19 Mar 2025 02:13:14 +0000 (03:13 +0100)
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>
net/xfrm/xfrm_policy.c

index 6551e588fe526fb2b4ea93ff0487d4d13b772c81..30970d40a454f4644a41cc8d5b7248133ea2ff10 100644 (file)
@@ -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;