[PATCH v1] net:xfrm:use IS_ERR() with __xfrm_policy_eval_candidates()
From: Yang Ruibin
Date: Wed Aug 21 2024 - 07:52:42 EST
__xfrm_policy_eval_candidates() function maybe returns
error pointers,So use IS_ERR() to check it.
Signed-off-by: Yang Ruibin <11162571@xxxxxxxx>
---
net/xfrm/xfrm_policy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index c56c61b0c12e..2e412a48b981 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2156,7 +2156,7 @@ xfrm_policy_eval_candidates(struct xfrm_pol_inexact_candidates *cand,
tmp = __xfrm_policy_eval_candidates(cand->res[i],
prefer,
fl, type, family, if_id);
- if (!tmp)
+ if (IS_ERR(tmp))
continue;
if (IS_ERR(tmp))
--
2.34.1