]> git.baikalelectronics.ru Git - kernel.git/commit
rxrpc: Fix missing unlock in rxrpc_do_sendmsg()
authorDavid Howells <dhowells@redhat.com>
Thu, 15 Dec 2022 16:19:47 +0000 (16:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:33 +0000 (11:41 +0100)
commit22229f596bbe99398f43256f309d31e65e66293c
treeaccf0354422155f5101f61a23dab7b49baf79172
parent875b0804e98036a936880325a3830da5212856a0
rxrpc: Fix missing unlock in rxrpc_do_sendmsg()

[ Upstream commit f9fa29b8e9a62e7ad4d0a277efd98fb6249b1003 ]

One of the error paths in rxrpc_do_sendmsg() doesn't unlock the call mutex
before returning.  Fix it to do this.

Note that this still doesn't get rid of the checker warning:

   ../net/rxrpc/sendmsg.c:617:5: warning: context imbalance in 'rxrpc_do_sendmsg' - wrong count at exit

I think the interplay between the socket lock and the call's user_mutex may
be too complicated for checker to analyse, especially as
rxrpc_new_client_call_for_sendmsg(), which it calls, returns with the
call's user_mutex if successful but unconditionally drops the socket lock.

Fixes: bdb5995807ae ("rxrpc: Provide a cmsg to specify the amount of Tx data for a call")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/rxrpc/sendmsg.c