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

Commit 0360da6d authored by David Howells's avatar David Howells
Browse files

rxrpc: Purge the to_be_accepted queue on socket release



Purge the queue of to_be_accepted calls on socket release.  Note that
purging sock_calls doesn't release the ref owned by to_be_accepted.

Probably the sock_calls list is redundant given a purges of the recvmsg_q,
the to_be_accepted queue and the calls tree.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent e6f3afb3
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -476,6 +476,16 @@ void rxrpc_release_calls_on_socket(struct rxrpc_sock *rx)


	_enter("%p", rx);
	_enter("%p", rx);


	while (!list_empty(&rx->to_be_accepted)) {
		call = list_entry(rx->to_be_accepted.next,
				  struct rxrpc_call, accept_link);
		list_del(&call->accept_link);
		rxrpc_abort_call("SKR", call, 0, RX_CALL_DEAD, ECONNRESET);
		rxrpc_send_call_packet(call, RXRPC_PACKET_TYPE_ABORT);
		rxrpc_release_call(rx, call);
		rxrpc_put_call(call, rxrpc_call_put);
	}

	while (!list_empty(&rx->sock_calls)) {
	while (!list_empty(&rx->sock_calls)) {
		call = list_entry(rx->sock_calls.next,
		call = list_entry(rx->sock_calls.next,
				  struct rxrpc_call, sock_link);
				  struct rxrpc_call, sock_link);