patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Nikhil Rao <nikhil.rao@intel.com>
To: yskoh@mellanox.com
Cc: Nikhil Rao <nikhil.rao@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH 17.11] eventdev: fix unlock in Rx adapter
Date: Thu, 17 Jan 2019 10:17:11 +0530	[thread overview]
Message-ID: <1547700431-145205-1-git-send-email-nikhil.rao@intel.com> (raw)

[ backported from upstream commit e846cfdec34cc58b9a1a2438d313028246b8e986 ]

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 d5c3fd5..de4cf73 100644
--- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
@@ -545,8 +545,8 @@ static uint16_t gcd_u16(uint16_t a, uint16_t b)
 	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;
 	}
 	eth_rx_poll(rx_adapter);
 	rte_spinlock_unlock(&rx_adapter->rx_lock);
-- 
1.8.3.1

             reply	other threads:[~2019-01-17  5:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17  4:47 Nikhil Rao [this message]
2019-01-17  6:57 ` Yongseok Koh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1547700431-145205-1-git-send-email-nikhil.rao@intel.com \
    --to=nikhil.rao@intel.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).