]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
rxrpc: The mutex lock returned by rxrpc_accept_call() needs releasing
authorDavid Howells <dhowells@redhat.com>
Fri, 24 Nov 2017 10:18:40 +0000 (10:18 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 24 Nov 2017 10:18:40 +0000 (10:18 +0000)
The caller of rxrpc_accept_call() must release the lock on call->user_mutex
returned by that function.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/sendmsg.c

index 7d2595582c094cf4b30a93e1148227d6480c202e..3a99b1a908df5bbb1bec67aff0c814d2ed2f2ee5 100644 (file)
@@ -619,8 +619,8 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
                /* The socket is now unlocked. */
                if (IS_ERR(call))
                        return PTR_ERR(call);
-               rxrpc_put_call(call, rxrpc_call_put);
-               return 0;
+               ret = 0;
+               goto out_put_unlock;
        }
 
        call = rxrpc_find_call_by_user_ID(rx, p.user_call_ID);
@@ -689,6 +689,7 @@ int rxrpc_do_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
                ret = rxrpc_send_data(rx, call, msg, len, NULL);
        }
 
+out_put_unlock:
        mutex_unlock(&call->user_mutex);
 error_put:
        rxrpc_put_call(call, rxrpc_call_put);