Skip to contentSkip to conversation

rxrpc: checking for IS_ERR() instead of NULL

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 18, 2016 – Jun 21, 2016

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

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

rxrpc_lookup_peer_rcu() returns NULL on error, it never returns error pointers.

Fixes be6e6707f6ee ('rxrpc: Rework peer object handling to use hash table and RCU')
net/rxrpc/input.c +1 -1
index 47fb167..e11e4d7 100644
@@ -639,7 +639,7 @@ static struct rxrpc_connection *rxrpc_conn_from_local(struct rxrpc_local *local,
 	rxrpc_get_addr_from_skb(local, skb, &srx);
 	rcu_read_lock();
 	peer = rxrpc_lookup_peer_rcu(local, &srx);
-	if (IS_ERR(peer))
+	if (!peer)
 		goto cant_find_peer;
 
 	trans = rxrpc_find_transport(local, peer);
maintainer Applied
#1 lore raw
Quoted 5 lines · Dan Carpenter

rxrpc_lookup_peer_rcu() returns NULL on error, it never returns error pointers.

Fixes be6e6707f6ee ('rxrpc: Rework peer object handling to use hash table and RCU')

Applied.