Skip to content

Commit

Permalink
RxRPC: Error handling for rxrpc_alloc_connection()
Browse files Browse the repository at this point in the history
rxrpc_alloc_connection() doesn't return an error code on failure, it just
returns NULL.  IS_ERR(NULL) is false.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed May 21, 2009
1 parent 3ed18d7 commit 0975ecb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/rxrpc/ar-connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
/* not yet present - create a candidate for a new connection
* and then redo the check */
conn = rxrpc_alloc_connection(gfp);
if (IS_ERR(conn)) {
_leave(" = %ld", PTR_ERR(conn));
return PTR_ERR(conn);
if (!conn) {
_leave(" = -ENOMEM");
return -ENOMEM;
}

conn->trans = trans;
Expand Down Expand Up @@ -508,9 +508,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
/* not yet present - create a candidate for a new connection and then
* redo the check */
candidate = rxrpc_alloc_connection(gfp);
if (IS_ERR(candidate)) {
_leave(" = %ld", PTR_ERR(candidate));
return PTR_ERR(candidate);
if (!candidate) {
_leave(" = -ENOMEM");
return -ENOMEM;
}

candidate->trans = trans;
Expand Down

0 comments on commit 0975ecb

Please sign in to comment.