Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0975ecba authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3ed18d76
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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;