diff mbox

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

Message ID 1450438154-2062-7-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov Dec. 18, 2015, 11:29 a.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 e978420..8081373 100644
--- a/platform/linux-generic/pktio/ring.c
+++ b/platform/linux-generic/pktio/ring.c
@@ -79,6 +79,7 @@ 
 #include "odph_debug.h"
 #include <odp/rwlock.h>
 #include <odp_packet_io_ring_internal.h>
+#include <odp_internal.h>
 
 static TAILQ_HEAD(, _ring) odp_ring_list;
 
@@ -171,6 +172,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;
 	}
 
@@ -203,6 +205,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");
 	}