Messages in this thread | | | Date | Mon, 22 Aug 2022 16:44:43 +0300 | From | Dan Carpenter <> | Subject | Re: [PATCH] rxrpc: fix bad unlock balance in rxrpc_do_sendmsg |
| |
On Mon, Aug 22, 2022 at 09:04:14PM +0800, Hawkins Jiawei wrote: > static int rxrpc_send_data(struct rxrpc_sock *rx, > struct rxrpc_call *call, > struct msghdr *msg, size_t len, > - rxrpc_notify_end_tx_t notify_end_tx) > + rxrpc_notify_end_tx_t notify_end_tx, > + bool *holding_mutex) > { > struct rxrpc_skb_priv *sp; > struct sk_buff *skb; > @@ -299,6 +318,13 @@ static int rxrpc_send_data(struct rxrpc_sock *rx, > bool more; > int ret, copied; > > + /* > + * The caller holds the call->user_mutex when calls > + * rxrpc_send_data(), so initial it with True > + */ > + if (holding_mutex) > + *holding_mutex = true;
Don't make this optional. All callers have to care if we dropped the lock.
regards, dan carpenter
| |