From 1cbeaa0eadbbc228a78e930ffdaa603eff4ff2ec Mon Sep 17 00:00:00 2001 From: Henry Cai Date: Wed, 5 Apr 2017 21:19:53 +0800 Subject: [PATCH] net/i40e: fix allocation check function i40evf_add_del_all_mac_addr without check return value of rte_zmalloc Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address") Cc: stable@dpdk.org Signed-off-by: Henry Cai Acked-by: Helin Zhang --- drivers/net/i40e/i40e_ethdev_vf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index cd9e51f56d..fa4d90efa9 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2024,6 +2024,10 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) } list = rte_zmalloc("i40evf_del_mac_buffer", len, 0); + if (!list) { + PMD_DRV_LOG(ERR, "fail to allocate memory"); + return; + } for (i = begin; i < next_begin; i++) { addr = &dev->data->mac_addrs[i]; -- 2.20.1