Rx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex
[openafs.git] / src / rx / rx_packet.c
index 4ab4366..a8364df 100644 (file)
@@ -1374,7 +1374,9 @@ rxi_AllocSendPacket(struct rx_call *call, int want)
         * just wait.  */
        NETPRI;
        call->flags |= RX_CALL_WAIT_PACKETS;
+        MUTEX_ENTER(&rx_refcnt_mutex);
        CALL_HOLD(call, RX_CALL_REFCOUNT_PACKET);
+        MUTEX_EXIT(&rx_refcnt_mutex);
        MUTEX_EXIT(&call->lock);
        rx_waitingForPackets = 1;
 
@@ -1385,7 +1387,9 @@ rxi_AllocSendPacket(struct rx_call *call, int want)
 #endif
        MUTEX_EXIT(&rx_freePktQ_lock);
        MUTEX_ENTER(&call->lock);
+        MUTEX_ENTER(&rx_refcnt_mutex);
        CALL_RELE(call, RX_CALL_REFCOUNT_PACKET);
+        MUTEX_EXIT(&rx_refcnt_mutex);
        call->flags &= ~RX_CALL_WAIT_PACKETS;
        USERPRI;
     }