Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux-block.git] / net / rxrpc / af_rxrpc.c
index 73c980e26581d23d02fd9d8f600985a06ec7e425..054e32872808553f7d51a71d5b0d8ac985ef0ff0 100644 (file)
@@ -311,10 +311,11 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,
        call = rxrpc_new_client_call(rx, &cp, srx, user_call_ID, tx_total_len,
                                     gfp);
        /* The socket has been unlocked. */
-       if (!IS_ERR(call))
+       if (!IS_ERR(call)) {
                call->notify_rx = notify_rx;
+               mutex_unlock(&call->user_mutex);
+       }
 
-       mutex_unlock(&call->user_mutex);
        _leave(" = %p", call);
        return call;
 }