Skip to content

Commit

Permalink
rxrpc: Fix an error goto in rxrpc_connect_call()
Browse files Browse the repository at this point in the history
Fix an error-handling goto in rxrpc_connect_call() whereby it will jump to
free the bundle it failed to allocate.

Fixes: 245500d ("rxrpc: Rewrite the client connection manager")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Sep 14, 2020
1 parent e059c6f commit 456b2f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/rxrpc/conn_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
/* Paired with the write barrier in rxrpc_activate_one_channel(). */
smp_rmb();

out:
out_put_bundle:
rxrpc_put_bundle(bundle);
out:
_leave(" = %d", ret);
return ret;

Expand All @@ -742,7 +743,7 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
trace_rxrpc_client(call->conn, ret, rxrpc_client_chan_wait_failed);
rxrpc_set_call_completion(call, RXRPC_CALL_LOCAL_ERROR, 0, ret);
rxrpc_disconnect_client_call(bundle, call);
goto out;
goto out_put_bundle;
}

/*
Expand Down

0 comments on commit 456b2f2

Please sign in to comment.