Re: [PATCH] rxrpc: fix bad unlock balance in rxrpc_do_sendmsg
From: Dan Carpenter
Date: Mon Aug 22 2022 - 09:46:36 EST
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