From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B4BE33B5 for ; Tue, 28 Mar 2017 03:29:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490664571; x=1522200571; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PhvcGQS5euw++x/IojulFHs+Pnuv6BquiQ2EC/vzMsQ=; b=McD/qsWHi3c8nVk7VXeok21z1Q8yWI35X67lhVkaehpL2Vx2NjKsjIhY vwqF7n2qGwPzrRnu4Jt7Kh3TM9Kbrg==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 18:29:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,234,1486454400"; d="scan'208";a="81669773" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2017 18:29:30 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 27 Mar 2017 18:29:29 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 27 Mar 2017 18:29:29 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.253]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.224]) with mapi id 14.03.0248.002; Tue, 28 Mar 2017 09:29:27 +0800 From: "Zhang, Helin" To: caihe CC: "Wu, Jingjing" , "dev@dpdk.org" , wangyunjian , "Lilijun (Jerry)" , Zhoujingbin Thread-Topic: [dpdk-dev] [PATCH 1/1] net/i40e: check return value of rte_zmalloc Thread-Index: AdKlY4PXehXrYe03RFO4Qp1wBl8x9gB/sHGQ Date: Tue, 28 Mar 2017 01:29:27 +0000 Message-ID: References: <453363AE6316CC428D594009B784F9050335F139@SZXEMI508-MBS.china.huawei.com> In-Reply-To: <453363AE6316CC428D594009B784F9050335F139@SZXEMI508-MBS.china.huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/1] net/i40e: check return value of rte_zmalloc 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: Tue, 28 Mar 2017 01:29:32 -0000 Hi Cai He Yes, I agree with you. Please rework your patch, and send out another version. Thank you very much= for the good catch! Regards, Helin > -----Original Message----- > From: caihe [mailto:caihe@huawei.com]=20 > Sent: Saturday, March 25, 2017 8:30 PM > To: Zhang, Helin > Cc: Wu, Jingjing ; dev@dpdk.org; wangyunjian ; Lilijun (Jerry) ; Zhoujingbi= n > Subject: [dpdk-dev] [PATCH 1/1] net/i40e: check return value of rte_zmall= oc I think it can be a bug fix, so please start with 'fix' in the title. > > Hi helin, > > There is a bug without check the return value of alloc memory in function= i40evf_add_del_all_mac_addr, if we should fix it as below: Please describe the issue with more details. 'Signoff' line is needed, please use 'git format --signoff <>' to generate = the patches. 'Fix' line is also needed, as it is a bug fix. Please refer to other fix co= mmit for more details.=20 > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_vf.c > index 55fd344..37ea7ac 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -2014,6 +2014,11 @@ static int i40evf_dev_xstats_get(struct rte_eth_de= v *dev, > } > =20 > list =3D rte_zmalloc("i40evf_del_mac_buffer", len, 0); > + if (!list) { > + PMD_DRV_LOG(ERR, "fail to alloc memory, abort exe= cute command %s", > + add ? "OP_ADD_ETHER_ADDRESS" : "OP_DEL_ET= HER_ADDRESS"); > + return; > + } > =20 > for (i =3D begin; i < next_begin; i++) { > addr =3D &dev->data->mac_addrs[i]; > > Best Regards