lkml.org 
[lkml]   [2013]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [RXRPC]: do not unlock unheld spinlock in rxrpc_connect_exclusive()
Date
If rx->conn is not NULL, rxrpc_connect_exclusive() does not
acquire the transport's client lock, but it still releases it.

The patch adds locking of the spinlock to this path.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
net/rxrpc/ar-connection.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 4106ca95ec86..4790140a1722 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -381,6 +381,11 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,

rxrpc_assign_connection_id(conn);
rx->conn = conn;
+ } else {
+ spin_lock(&trans->client_lock);
+
+ _net("CONNECT EXCL old %d on TRANS %d",
+ conn->debug_id, conn->trans->debug_id);
}

/* we've got a connection with a free channel and we can now attach the
--
1.8.3.2


\
 
 \ /
  Last update: 2013-12-14 00:21    [W:0.119 / U:0.532 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site