rxrpc: Fix leak of rxrpc_peer objects
When a new client call is requested, an rxrpc_conn_parameters struct object
is passed in with a bunch of parameters set, such as the local endpoint to
use. A pointer to the target peer record is also placed in there by
rxrpc_get_client_conn() - and this is removed if and only if a new
connection object is allocated. Thus it leaks if a new connection object
isn't allocated.
Fix this by putting any peer object attached to the rxrpc_conn_parameters
object in the function that allocated it.
Fixes: 19ffa01c9c
("rxrpc: Use structs to hold connection params and protocol info")
Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
@@ -118,6 +118,7 @@ static __net_exit void rxrpc_exit_net(struct net *net)
|
||||
cancel_work_sync(&rxnet->peer_keepalive_work);
|
||||
rxrpc_destroy_all_calls(rxnet);
|
||||
rxrpc_destroy_all_connections(rxnet);
|
||||
rxrpc_destroy_all_peers(rxnet);
|
||||
rxrpc_destroy_all_locals(rxnet);
|
||||
proc_remove(rxnet->proc_net);
|
||||
}
|
||||
|
Reference in New Issue
Block a user