diff mbox

[API-NEXT,PATCHv20,6/9] linux-generic: ring set up __odp_errno as doxygen says

Message ID 1455109705-5871-7-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 5bdb4beeeb048acb252d9940800db3cfd04fa31f
Headers show

Commit Message

Maxim Uvarov Feb. 10, 2016, 1:08 p.m. UTC
Accodring to doxygen comment if ring creation fails __odp_errno
should be set.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/pktio/ring.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/platform/linux-generic/pktio/ring.c b/platform/linux-generic/pktio/ring.c
index d25d497..b20941c 100644
--- a/platform/linux-generic/pktio/ring.c
+++ b/platform/linux-generic/pktio/ring.c
@@ -75,6 +75,7 @@ 
 #include <string.h>
 #include "odph_debug.h"
 #include <odp_packet_io_ring_internal.h>
+#include <odp_internal.h>
 
 static TAILQ_HEAD(, _ring) odp_ring_list;
 
@@ -167,6 +168,7 @@  _ring_create(const char *name, unsigned count, unsigned flags)
 		ODPH_ERR("Requested size is invalid, must be power of 2,"
 			 "and do not exceed the size limit %u\n",
 			 _RING_SZ_MASK);
+		__odp_errno = EINVAL;
 		return NULL;
 	}
 
@@ -199,6 +201,7 @@  _ring_create(const char *name, unsigned count, unsigned flags)
 		if (!(flags & _RING_NO_LIST))
 			TAILQ_INSERT_TAIL(&odp_ring_list, r, next);
 	} else {
+		__odp_errno = ENOMEM;
 		ODPH_ERR("Cannot reserve memory\n");
 	}