diff mbox

check for null pointer in get_entry() return

Message ID 1416932951-3861-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 53c6bf187ccccffe02d603c82cdbaaf1b3b7ef6f
Headers show

Commit Message

Maxim Uvarov Nov. 25, 2014, 4:29 p.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_packet_io.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index c523350..5c8146a 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -165,6 +165,8 @@  odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool)
 	/* if successful, alloc_pktio_entry() returns with the entry locked */
 
 	pktio_entry = get_entry(id);
+	if (!pktio_entry)
+		return ODP_PKTIO_INVALID;
 
 	ODP_DBG("ODP_PKTIO_USE_FANOUT: %d\n", fanout);
 	if (getenv("ODP_PKTIO_DISABLE_SOCKET_MMAP") == NULL) {