From ef7490695b10de16d93d41244973b9d1667d97df Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 29 Nov 2005 07:01:50 +0000 Subject: [PATCH] STABLE14-rx-lock-leak-20051128 Fix a lock leak introduced when adding thread local packet queues. (cherry picked from commit ae2f1d3f68266a47d04b62fab577ada30990732c) --- src/rx/rx.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index baefb694c..504e9c7aa 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -2851,11 +2851,15 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket, np = rxi_ReceiveAckPacket(call, np, 1); break; case RX_PACKET_TYPE_ABORT: - /* An abort packet: reset the connection, passing the error up to - * the user */ + /* An abort packet: reset the call, passing the error up to the user. */ /* What if error is zero? */ + /* What if the error is -1? the application will treat it as a timeout. */ rxi_CallError(call, ntohl(*(afs_int32 *) rx_DataOf(np))); - break; + MUTEX_EXIT(&call->lock); + MUTEX_ENTER(&conn->conn_data_lock); + conn->refCount--; + MUTEX_EXIT(&conn->conn_data_lock); + return np; /* xmitting; drop packet */ case RX_PACKET_TYPE_BUSY: /* XXXX */ break; @@ -2877,7 +2881,10 @@ rxi_ReceivePacket(register struct rx_packet *np, osi_socket socket, rxi_SetAcksInTransmitQueue(call); break; #else /* RX_ENABLE_LOCKS */ + MUTEX_EXIT(&call->lock); + MUTEX_ENTER(&conn->conn_data_lock); conn->refCount--; + MUTEX_EXIT(&conn->conn_data_lock); return np; /* xmitting; drop packet */ #endif /* RX_ENABLE_LOCKS */ } -- 2.39.5