diff mbox series

[v1] net:xfrm:use IS_ERR() with __xfrm_policy_eval_candidates()

Message ID 20240821113808.6744-1-11162571@vivo.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [v1] net:xfrm:use IS_ERR() with __xfrm_policy_eval_candidates() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 26 this patch: 26
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-08-21--12-00 (tests: 711)

Commit Message

Yang Ruibin Aug. 21, 2024, 11:38 a.m. UTC
__xfrm_policy_eval_candidates() function maybe returns
error pointers,So use IS_ERR() to check it.

Signed-off-by: Yang Ruibin <11162571@vivo.com>
---
 net/xfrm/xfrm_policy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steffen Klassert Aug. 21, 2024, 12:11 p.m. UTC | #1
On Wed, Aug 21, 2024 at 07:38:06AM -0400, Yang Ruibin wrote:
> __xfrm_policy_eval_candidates() function maybe returns
> error pointers,So use IS_ERR() to check it.
> 
> Signed-off-by: Yang Ruibin <11162571@vivo.com>
> ---
>  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;

This looks wrong. The error case is already handled below.

>  		if (IS_ERR(tmp))
> -- 
> 2.34.1
diff mbox series

Patch

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))