RxRPC: Error handling for rxrpc_alloc_connection()
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>
This commit is contained in:
parent
3ed18d76d9
commit
0975ecba3b
1 changed files with 6 additions and 6 deletions
|
@ -343,9 +343,9 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
|
||||||
/* not yet present - create a candidate for a new connection
|
/* not yet present - create a candidate for a new connection
|
||||||
* and then redo the check */
|
* and then redo the check */
|
||||||
conn = rxrpc_alloc_connection(gfp);
|
conn = rxrpc_alloc_connection(gfp);
|
||||||
if (IS_ERR(conn)) {
|
if (!conn) {
|
||||||
_leave(" = %ld", PTR_ERR(conn));
|
_leave(" = -ENOMEM");
|
||||||
return PTR_ERR(conn);
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn->trans = trans;
|
conn->trans = trans;
|
||||||
|
@ -508,9 +508,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
|
||||||
/* not yet present - create a candidate for a new connection and then
|
/* not yet present - create a candidate for a new connection and then
|
||||||
* redo the check */
|
* redo the check */
|
||||||
candidate = rxrpc_alloc_connection(gfp);
|
candidate = rxrpc_alloc_connection(gfp);
|
||||||
if (IS_ERR(candidate)) {
|
if (!candidate) {
|
||||||
_leave(" = %ld", PTR_ERR(candidate));
|
_leave(" = -ENOMEM");
|
||||||
return PTR_ERR(candidate);
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
candidate->trans = trans;
|
candidate->trans = trans;
|
||||||
|
|
Loading…
Reference in a new issue