diff mbox series

[v1,1/3] linux-gen: pktio: add missing unlock

Message ID 1508338806-1394-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v1,1/3] linux-gen: pktio: add missing unlock | expand

Commit Message

Github ODP bot Oct. 18, 2017, 3 p.m. UTC
From: Maxim Uvarov <maxim.uvarov@linaro.org>


add missing unlock on return.
https://bugs.linaro.org/show_bug.cgi?id=3242

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 239 (muvarov:master_bug3242)
 ** https://github.com/Linaro/odp/pull/239
 ** Patch: https://github.com/Linaro/odp/pull/239.patch
 ** Base sha: ec0c3145fcafa09ae3a79875e7e07dd4794583cc
 ** Merge commit sha: 13cc3007dc36c8942ffe7dd834f3812b32ae2ae3
 **/
 platform/linux-generic/odp_packet_io.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 5cf94a146..c2e6742b2 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -202,8 +202,10 @@  static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool,
 
 	/* if successful, alloc_pktio_entry() returns with the entry locked */
 	pktio_entry = get_pktio_entry(hdl);
-	if (!pktio_entry)
+	if (!pktio_entry) {
+		unlock_entry(pktio_entry);
 		return ODP_PKTIO_INVALID;
+	}
 
 	pktio_entry->s.pool = pool;
 	memcpy(&pktio_entry->s.param, param, sizeof(odp_pktio_param_t));