event: fix ring init failure handling
authorHarry van Haaren <harry.van.haaren@intel.com>
Thu, 2 Aug 2018 14:43:29 +0000 (15:43 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 5 Aug 2018 12:52:19 +0000 (14:52 +0200)
commit219ae4a12995e5a8ee5e184655a37dd4ee96bf25
tree029b229863a105c2b3a8caecdef2862948738464
parentb85b719ab7c05dc821ff05bca9cd2b7ff7b0b7ed
event: fix ring init failure handling

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")
Cc: stable@dpdk.org
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