diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-06-18 11:44:03 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2016-06-22 11:09:58 +0300 |
commit | 0e4699e4a37be4cfa07f0340cef6a3fa6a46f5f8 (patch) | |
tree | b30879ac5a1734d71521923d429a407a2bf273dc /net/rxrpc/af_rxrpc.c | |
parent | 0e9390ebf1fe0d38f7df66a3d8183cbc5349a564 (diff) | |
download | linux-0e4699e4a37be4cfa07f0340cef6a3fa6a46f5f8.tar.xz |
rxrpc: checking for IS_ERR() instead of NULL
rxrpc_lookup_peer_rcu() and rxrpc_lookup_peer() return NULL on error, never
error pointers, so IS_ERR() can't be used.
Fix three callers of those functions.
Fixes: be6e6707f6ee ('rxrpc: Rework peer object handling to use hash table and RCU')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/af_rxrpc.c')
-rw-r--r-- | net/rxrpc/af_rxrpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c index c83c3c75d665..9dd160bb16d2 100644 --- a/net/rxrpc/af_rxrpc.c +++ b/net/rxrpc/af_rxrpc.c @@ -247,8 +247,8 @@ struct rxrpc_transport *rxrpc_name_to_transport(struct rxrpc_sock *rx, /* find a remote transport endpoint from the local one */ peer = rxrpc_lookup_peer(rx->local, srx, gfp); - if (IS_ERR(peer)) - return ERR_CAST(peer); + if (!peer) + return ERR_PTR(-ENOMEM); /* find a transport */ trans = rxrpc_get_transport(rx->local, peer, gfp); |