From 7f4a1aa1430d085b80b6a483aac0e729a0b4f6df Mon Sep 17 00:00:00 2001 From: RongQiang Xie Date: Wed, 23 Aug 2017 16:49:24 +0800 Subject: [PATCH] net/enic: fix possible null pointer dereference In enic_alloc_consistent() function, if rte_malloc for mze is failed, !mze is true, memzone should be freed and function should return NULL. Fixes: da5f560be966 ("net/enic: fix memory freeing") Cc: stable@dpdk.org Signed-off-by: RongQiang Xie Reviewed-by: Ferruh Yigit --- drivers/net/enic/enic_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 40dbec7fa2..1d956cd949 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -368,6 +368,7 @@ enic_alloc_consistent(void *priv, size_t size, pr_err("%s : Failed to allocate memory for memzone list\n", __func__); rte_memzone_free(rz); + return NULL; } mze->rz = rz; -- 2.20.1