Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Alexei Starovoitov <[email protected]>
To: Daniel Borkmann <[email protected]>
To: "David S. Miller" <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Jesper Dangaard Brouer <[email protected]>
To: John Fastabend <[email protected]>
To: Stanislav Fomichev <[email protected]>
To: Eric Dumazet <[email protected]>
To: Paolo Abeni <[email protected]>
To: Simon Horman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Philipp Hahn <[email protected]>
---
 net/core/xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/xdp.c b/net/core/xdp.c
index 
9890a30584ba7b08b246dacb984b639908f16242..c92cac2ccdb759457c7ce6a38e04e20190dff2a3
 100644
--- a/net/core/xdp.c
+++ b/net/core/xdp.c
@@ -101,7 +101,7 @@ static void mem_allocator_disconnect(void *allocator)
        do {
                rhashtable_walk_start(&iter);
 
-               while ((xa = rhashtable_walk_next(&iter)) && !IS_ERR(xa)) {
+               while (!IS_ERR_OR_NULL((xa = rhashtable_walk_next(&iter)))) {
                        if (xa->allocator == allocator)
                                mem_xa_remove(xa);
                }

-- 
2.43.0


Reply via email to