From: Henry Cai Date: Wed, 5 Apr 2017 13:19:53 +0000 (+0800) Subject: net/i40e: fix allocation check X-Git-Tag: spdx-start~3630 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1cbeaa0eadbbc228a78e930ffdaa603eff4ff2ec;p=dpdk.git 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 --- 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];