diff mbox series

eventdev: fix missing unlock in eth Rx adapter

Message ID 20181120220915.75201-1-nikhil.rao@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers show
Series eventdev: fix missing unlock in eth Rx adapter | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Rao, Nikhil Nov. 20, 2018, 10:09 p.m. UTC
From: Nikhil Rao <nikhil.rao@intel.com>

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>
---
 lib/librte_eventdev/rte_event_eth_rx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jerin Jacob Nov. 21, 2018, 12:48 p.m. UTC | #1
-----Original Message-----
> Date: Wed, 21 Nov 2018 03:39:15 +0530
> From: nikhil.rao@intel.com
> To: dev@dpdk.org
> CC: Nikhil Rao <nikhil.rao@intel.com>, stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] eventdev: fix missing unlock in eth Rx adapter
> X-Mailer: git-send-email 2.14.1.145.gb3622a4
> 
> 
> From: Nikhil Rao <nikhil.rao@intel.com>
> 
> 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> index 71d008cd1..8831bc35f 100644
> --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> @@ -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;
> --
> 2.14.1.145.gb3622a4
>
Thomas Monjalon Nov. 23, 2018, 1:04 a.m. UTC | #2
21/11/2018 13:48, Jerin Jacob:
> > From: Nikhil Rao <nikhil.rao@intel.com>
> > 
> > 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>

Applied, thanks
diff mbox series

Patch

diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
index 71d008cd1..8831bc35f 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -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;