From: Yongseok Koh <yskoh@mellanox.com>
To: Harry van Haaren <harry.van.haaren@intel.com>
Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>,
dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'event: fix ring init failure handling' has been queued to LTS release 17.11.4
Date: Mon, 13 Aug 2018 13:42:10 -0700 [thread overview]
Message-ID: <20180813204213.25436-7-yskoh@mellanox.com> (raw)
In-Reply-To: <20180813204213.25436-1-yskoh@mellanox.com>
Hi,
FYI, your patch has been queued to LTS release 17.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/15/18. So please
shout if anyone has objections.
Thanks.
Yongseok
---
>From 24e718ba4b191e5513d9d923cd3efc2a71485f9e Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren@intel.com>
Date: Thu, 2 Aug 2018 15:43:29 +0100
Subject: [PATCH] event: fix ring init failure handling
[ upstream commit 219ae4a12995e5a8ee5e184655a37dd4ee96bf25 ]
This commit fixes a bug in a 32-bit environment where the
generic ring_init() would fail, but given the interaction
with memzones the next iteration of the event_ring_autotest
would actually *pass* because the ring in question would
exist already an be looked-up.
This commit rightly error checks the result of ring_init(),
and calls rte_free() on the memory as required.
Fixes: dc39e2f359b5 ("eventdev: add ring structure for events")
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
lib/librte_eventdev/rte_event_ring.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/lib/librte_eventdev/rte_event_ring.c b/lib/librte_eventdev/rte_event_ring.c
index b14c2127f..c0603cb99 100644
--- a/lib/librte_eventdev/rte_event_ring.c
+++ b/lib/librte_eventdev/rte_event_ring.c
@@ -110,11 +110,16 @@ rte_event_ring_create(const char *name, unsigned int count, int socket_id,
mz = rte_memzone_reserve(mz_name, ring_size, socket_id, mz_flags);
if (mz != NULL) {
r = mz->addr;
- /*
- * no need to check return value here, we already checked the
- * arguments above
- */
- rte_event_ring_init(r, name, requested_count, flags);
+ /* Check return value in case rte_ring_init() fails on size */
+ int err = rte_event_ring_init(r, name, requested_count, flags);
+ if (err) {
+ RTE_LOG(ERR, RING, "Ring init failed\n");
+ if (rte_memzone_free(mz) != 0)
+ RTE_LOG(ERR, RING, "Cannot free memzone\n");
+ rte_free(te);
+ rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ return NULL;
+ }
te->data = (void *) r;
r->r.memzone = mz;
--
2.11.0
next prev parent reply other threads:[~2018-08-13 20:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 20:42 [dpdk-stable] patch 'net/bnx2x: fix poll link status' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'net/dpaa2: remove loop for unused pool entries' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'net/mlx5: fix secondary process resource leakage' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'net/i40e: revert fix of flow director check' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'vhost: flush IOTLB cache on new mem table handling' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'net/bonding: fix race condition' " Yongseok Koh
2018-08-13 20:42 ` Yongseok Koh [this message]
2018-08-13 20:42 ` [dpdk-stable] patch 'app/crypto-perf: fix auth IV offset' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'eal: fix bitmap documentation' " Yongseok Koh
2018-08-13 20:42 ` [dpdk-stable] patch 'examples/flow_filtering: add flow director config for i40e' " 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=20180813204213.25436-7-yskoh@mellanox.com \
--to=yskoh@mellanox.com \
--cc=harry.van.haaren@intel.com \
--cc=jerin.jacob@caviumnetworks.com \
--cc=stable@dpdk.org \
/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).