Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL check. Change generated with coccinelle. To: Alexei Starovoitov To: Daniel Borkmann To: "David S. Miller" To: Jakub Kicinski To: Jesper Dangaard Brouer To: John Fastabend To: Stanislav Fomichev To: Eric Dumazet To: Paolo Abeni To: Simon Horman Cc: netdev@vger.kernel.org Cc: bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Philipp Hahn --- 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