Commit 8b7fac50 authored by David Howells's avatar David Howells

rxrpc: Pass the connection pointer to rxrpc_post_packet_to_call()

Pass the connection pointer to rxrpc_post_packet_to_call() as the call
might get disconnected whilst we're looking at it, but the connection
pointer determined by rxrpc_data_read() is guaranteed by RCU for the
duration of the call.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 278ac0cd
...@@ -497,7 +497,8 @@ static void rxrpc_process_jumbo_packet(struct rxrpc_call *call, ...@@ -497,7 +497,8 @@ static void rxrpc_process_jumbo_packet(struct rxrpc_call *call,
* post an incoming packet to the appropriate call/socket to deal with * post an incoming packet to the appropriate call/socket to deal with
* - must get rid of the sk_buff, either by freeing it or by queuing it * - must get rid of the sk_buff, either by freeing it or by queuing it
*/ */
static void rxrpc_post_packet_to_call(struct rxrpc_call *call, static void rxrpc_post_packet_to_call(struct rxrpc_connection *conn,
struct rxrpc_call *call,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct rxrpc_skb_priv *sp; struct rxrpc_skb_priv *sp;
...@@ -558,7 +559,7 @@ static void rxrpc_post_packet_to_call(struct rxrpc_call *call, ...@@ -558,7 +559,7 @@ static void rxrpc_post_packet_to_call(struct rxrpc_call *call,
dead_call: dead_call:
if (sp->hdr.type != RXRPC_PACKET_TYPE_ABORT) { if (sp->hdr.type != RXRPC_PACKET_TYPE_ABORT) {
skb->priority = RX_CALL_DEAD; skb->priority = RX_CALL_DEAD;
rxrpc_reject_packet(call->conn->params.local, skb); rxrpc_reject_packet(conn->params.local, skb);
goto unlock; goto unlock;
} }
free_unlock: free_unlock:
...@@ -754,7 +755,7 @@ void rxrpc_data_ready(struct sock *sk) ...@@ -754,7 +755,7 @@ void rxrpc_data_ready(struct sock *sk)
goto cant_route_call; goto cant_route_call;
rxrpc_see_call(call); rxrpc_see_call(call);
rxrpc_post_packet_to_call(call, skb); rxrpc_post_packet_to_call(conn, call, skb);
goto out_unlock; goto out_unlock;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment