Skip to contentSkip to conversation

rxrpc: checking for IS_ERR() instead of NULL

PATCH New Dan Carpenter 1 participant 1 message Jul 12, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rxrpc: checking for IS_ERR() instead of NULL

The rxrpc_lookup_peer() function returns NULL on error, it never returns error pointers.

Fixes 8496af50eb38 ('rxrpc: Use RCU to access a peer's service connection tree')

---
I don't think this has been merged with net-next so I didn't CC David or netdev. Feel free to fold this into the original commit.

net/rxrpc/conn_service.c +1 -1
index 7cbd612..fd9027c 100644
@@ -163,7 +163,7 @@ struct rxrpc_connection *rxrpc_incoming_connection(struct rxrpc_local *local,
 
 	if (!peer) {
 		peer = rxrpc_lookup_peer(local, srx, GFP_NOIO);
-		if (IS_ERR(peer))
+		if (!peer)
 			goto enomem;
 	}