aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/ar-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/rxrpc/ar-connection.c')
-rw-r--r--net/rxrpc/ar-connection.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 0f1218b8d289..9f1ce841a0bb 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -343,9 +343,9 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
343 /* not yet present - create a candidate for a new connection 343 /* not yet present - create a candidate for a new connection
344 * and then redo the check */ 344 * and then redo the check */
345 conn = rxrpc_alloc_connection(gfp); 345 conn = rxrpc_alloc_connection(gfp);
346 if (IS_ERR(conn)) { 346 if (!conn) {
347 _leave(" = %ld", PTR_ERR(conn)); 347 _leave(" = -ENOMEM");
348 return PTR_ERR(conn); 348 return -ENOMEM;
349 } 349 }
350 350
351 conn->trans = trans; 351 conn->trans = trans;
@@ -444,6 +444,11 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
444 conn = list_entry(bundle->avail_conns.next, 444 conn = list_entry(bundle->avail_conns.next,
445 struct rxrpc_connection, 445 struct rxrpc_connection,
446 bundle_link); 446 bundle_link);
447 if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
448 list_del_init(&conn->bundle_link);
449 bundle->num_conns--;
450 continue;
451 }
447 if (--conn->avail_calls == 0) 452 if (--conn->avail_calls == 0)
448 list_move(&conn->bundle_link, 453 list_move(&conn->bundle_link,
449 &bundle->busy_conns); 454 &bundle->busy_conns);
@@ -461,6 +466,11 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
461 conn = list_entry(bundle->unused_conns.next, 466 conn = list_entry(bundle->unused_conns.next,
462 struct rxrpc_connection, 467 struct rxrpc_connection,
463 bundle_link); 468 bundle_link);
469 if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
470 list_del_init(&conn->bundle_link);
471 bundle->num_conns--;
472 continue;
473 }
464 ASSERTCMP(conn->avail_calls, ==, RXRPC_MAXCALLS); 474 ASSERTCMP(conn->avail_calls, ==, RXRPC_MAXCALLS);
465 conn->avail_calls = RXRPC_MAXCALLS - 1; 475 conn->avail_calls = RXRPC_MAXCALLS - 1;
466 ASSERT(conn->channels[0] == NULL && 476 ASSERT(conn->channels[0] == NULL &&
@@ -508,9 +518,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
508 /* not yet present - create a candidate for a new connection and then 518 /* not yet present - create a candidate for a new connection and then
509 * redo the check */ 519 * redo the check */
510 candidate = rxrpc_alloc_connection(gfp); 520 candidate = rxrpc_alloc_connection(gfp);
511 if (IS_ERR(candidate)) { 521 if (!candidate) {
512 _leave(" = %ld", PTR_ERR(candidate)); 522 _leave(" = -ENOMEM");
513 return PTR_ERR(candidate); 523 return -ENOMEM;
514 } 524 }
515 525
516 candidate->trans = trans; 526 candidate->trans = trans;