From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dggrg01-dlp.huawei.com (unknown [45.249.212.187]) by dpdk.org (Postfix) with ESMTP id 096DA29C7 for ; Wed, 5 Apr 2017 15:20:10 +0200 (CEST) Received: from 172.30.72.56 (EHLO DGGEML401-HUB.china.huawei.com) ([172.30.72.56]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AMB53216; Wed, 05 Apr 2017 21:20:08 +0800 (CST) Received: from localhost (10.177.241.238) by DGGEML401-HUB.china.huawei.com (10.3.17.32) with Microsoft SMTP Server id 14.3.301.0; Wed, 5 Apr 2017 21:20:00 +0800 From: henry To: CC: , , , "henry cai" Date: Wed, 5 Apr 2017 21:19:53 +0800 Message-ID: <1491398393-14200-1-git-send-email-caihe@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.241.238] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.58E4EF09.001D, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 203c9fbc2d2f0f021b9ebd24df95c673 Subject: [dpdk-dev] [PATCH v3] net/i40e: fix return value check issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2017 13:20:13 -0000 From: henry cai 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 --- 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