DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3] net/i40e: fix return value check issue
@ 2017-04-05 13:19 henry
  2017-04-05 15:34 ` Zhang, Helin
  0 siblings, 1 reply; 8+ messages in thread
From: henry @ 2017-04-05 13:19 UTC (permalink / raw)
  To: helin.zhang; +Cc: dev, jingjing.wu, zhoujingbin, henry cai

From: henry cai <caihe@huawei.com>

function i40evf_add_del_all_mac_addr without check return value of rte_zmalloc

Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address ")

Signed-off-by: henry cai <caihe@huawei.com>
---
 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 d3659c9..3e0e2e1 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2016,6 +2016,10 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
 		}
 
 		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];
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-07 10:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 13:19 [dpdk-dev] [PATCH v3] net/i40e: fix return value check issue henry
2017-04-05 15:34 ` Zhang, Helin
2017-04-06  1:06   ` [dpdk-dev] 答复: " caihe
2017-04-06  6:35     ` [dpdk-dev] " Zhang, Helin
2017-04-06  7:26       ` [dpdk-dev] 答复: " caihe
2017-04-06  8:27         ` [dpdk-dev] " Zhang, Helin
2017-04-06  9:02           ` Ferruh Yigit
2017-04-07 10:52   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).