eventdev: fix unlock in Rx adapter
authorNikhil Rao <nikhil.rao@intel.com>
Tue, 20 Nov 2018 22:09:15 +0000 (03:39 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 23 Nov 2018 01:03:33 +0000 (02:03 +0100)
In the eth Rx adapter SW service function,
move the return to after the spinlock unlock.

Coverity issue: 302857
Fixes: a66a83744667 ("eventdev: fix Rx SW adapter stop")
Cc: stable@dpdk.org
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
lib/librte_eventdev/rte_event_eth_rx_adapter.c

index 71d008c..8831bc3 100644 (file)
@@ -1165,8 +1165,8 @@ rxa_service_func(void *args)
        if (rte_spinlock_trylock(&rx_adapter->rx_lock) == 0)
                return 0;
        if (!rx_adapter->rxa_started) {
-               return 0;
                rte_spinlock_unlock(&rx_adapter->rx_lock);
+               return 0;
        }
 
        stats = &rx_adapter->stats;