RE: [Intel-wired-lan] [PATCH 28/61] net/sched: Prefer IS_ERR_OR_NULL over manual NULL check

2026-03-11 Thread Loktionov, Aleksandr


> -Original Message-
> From: Intel-wired-lan  On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]; dm-
> [email protected]; [email protected];
> [email protected]; [email protected]; intel-wired-
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]; linux-security-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; [email protected];
> [email protected]; [email protected]; sched-
> [email protected]; [email protected]; tipc-
> [email protected]; [email protected]; Philipp Hahn
> 
> Cc: Hadi Salim, Jamal ; Jiri Pirko
> ; David S. Miller ; Eric
> Dumazet ; Jakub Kicinski ; Paolo
> Abeni ; Simon Horman 
> Subject: [Intel-wired-lan] [PATCH 28/61] net/sched: Prefer
> IS_ERR_OR_NULL over manual NULL check
> 
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
> 
> Change generated with coccinelle.
> 
> To: Jamal Hadi Salim 
> To: Jiri Pirko 
> To: "David S. Miller" 
> To: Eric Dumazet 
> To: Jakub Kicinski 
> To: Paolo Abeni 
> To: Simon Horman 
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Philipp Hahn 
> ---
>  net/sched/cls_api.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index
> 4829c27446e3369ad2ae9b3fcb285eca47d59933..4208225e7a4acaf0c331096ebf94
> 1f68cc2ed992 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -2444,7 +2444,7 @@ static int tc_new_tfilter(struct sk_buff *skb,
> struct nlmsghdr *n,
>   tcf_chain_tp_delete_empty(chain, tp, rtnl_held, NULL);
>  errout_tp:
>   if (chain) {
> - if (tp && !IS_ERR(tp))
> + if (!IS_ERR_OR_NULL(tp))
>   tcf_proto_put(tp, rtnl_held, NULL);
>   if (!tp_created)
>   tcf_chain_put(chain);
> @@ -2612,7 +2612,7 @@ static int tc_del_tfilter(struct sk_buff *skb,
> struct nlmsghdr *n,
> 
>  errout:
>   if (chain) {
> - if (tp && !IS_ERR(tp))
> + if (!IS_ERR_OR_NULL(tp))
>   tcf_proto_put(tp, rtnl_held, NULL);
>   tcf_chain_put(chain);
>   }
> @@ -2741,7 +2741,7 @@ static int tc_get_tfilter(struct sk_buff *skb,
> struct nlmsghdr *n,
>   tfilter_put(tp, fh);
>  errout:
>   if (chain) {
> - if (tp && !IS_ERR(tp))
> + if (!IS_ERR_OR_NULL(tp))
>   tcf_proto_put(tp, rtnl_held, NULL);
>   tcf_chain_put(chain);
>   }
> 
> --
> 2.43.0


Reviewed-by: Aleksandr Loktionov 


[PATCH 28/61] net/sched: Prefer IS_ERR_OR_NULL over manual NULL check

2026-03-10 Thread Philipp Hahn
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Jamal Hadi Salim 
To: Jiri Pirko 
To: "David S. Miller" 
To: Eric Dumazet 
To: Jakub Kicinski 
To: Paolo Abeni 
To: Simon Horman 
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Philipp Hahn 
---
 net/sched/cls_api.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 
4829c27446e3369ad2ae9b3fcb285eca47d59933..4208225e7a4acaf0c331096ebf941f68cc2ed992
 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -2444,7 +2444,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct 
nlmsghdr *n,
tcf_chain_tp_delete_empty(chain, tp, rtnl_held, NULL);
 errout_tp:
if (chain) {
-   if (tp && !IS_ERR(tp))
+   if (!IS_ERR_OR_NULL(tp))
tcf_proto_put(tp, rtnl_held, NULL);
if (!tp_created)
tcf_chain_put(chain);
@@ -2612,7 +2612,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct 
nlmsghdr *n,
 
 errout:
if (chain) {
-   if (tp && !IS_ERR(tp))
+   if (!IS_ERR_OR_NULL(tp))
tcf_proto_put(tp, rtnl_held, NULL);
tcf_chain_put(chain);
}
@@ -2741,7 +2741,7 @@ static int tc_get_tfilter(struct sk_buff *skb, struct 
nlmsghdr *n,
tfilter_put(tp, fh);
 errout:
if (chain) {
-   if (tp && !IS_ERR(tp))
+   if (!IS_ERR_OR_NULL(tp))
tcf_proto_put(tp, rtnl_held, NULL);
tcf_chain_put(chain);
}

-- 
2.43.0