netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next] rxrpc: checking for IS_ERR() instead of NULL
@ 2016-06-18  8:44 Dan Carpenter
  2016-06-21  8:47 ` David Howells
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2016-06-18  8:44 UTC (permalink / raw)
  To: David S. Miller, David Howells
  Cc: Eric Dumazet, Willem de Bruijn, netdev, kernel-janitors

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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 47fb167..e11e4d7 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH net-next] rxrpc: checking for IS_ERR() instead of NULL
@ 2016-07-14 14:47 David Howells
  2016-07-15 21:16 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: David Howells @ 2016-07-14 14:47 UTC (permalink / raw)
  To: davem; +Cc: dhowells, netdev, linux-afs, Dan Carpenter, linux-kernel

From: Dan Carpenter <dan.carpenter@oracle.com>

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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 net/rxrpc/conn_service.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rxrpc/conn_service.c b/net/rxrpc/conn_service.c
index 7cbd612be0d7..fd9027ccba8f 100644
--- a/net/rxrpc/conn_service.c
+++ b/net/rxrpc/conn_service.c
@@ -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;
 	}
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-15 21:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-18  8:44 [patch net-next] rxrpc: checking for IS_ERR() instead of NULL Dan Carpenter
2016-06-21  8:47 ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2016-07-14 14:47 [PATCH " David Howells
2016-07-15 21:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).