From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E99BAFABB for ; Mon, 27 Mar 2017 13:00:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490612421; x=1522148421; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=vEN+kR4Owa2KiH9fCdwbZ7P8OeNoiVM9wDdA0ZgPxyc=; b=b58ZUFGhHEyeQXKNxoZm+PVhoBumHs9kQqHIde1i2x6P1gOHNHQP8D/H U6Q/x5m4eTo6EiMhTUC2Ku6+ArQk4Q==; Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 04:00:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,231,1486454400"; d="scan'208";a="1127539853" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by fmsmga001.fm.intel.com with ESMTP; 27 Mar 2017 04:00:17 -0700 To: caihe , "helin.zhang@intel.com" References: <453363AE6316CC428D594009B784F9050335F139@SZXEMI508-MBS.china.huawei.com> Cc: "jingjing.wu@intel.com" , "dev@dpdk.org" , wangyunjian , "Lilijun (Jerry)" , Zhoujingbin From: Ferruh Yigit Message-ID: <84245870-8c4d-5631-3c8c-c87ae976b4c5@intel.com> Date: Mon, 27 Mar 2017 12:00:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <453363AE6316CC428D594009B784F9050335F139@SZXEMI508-MBS.china.huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: Mon, 27 Mar 2017 11:00:21 -0000 On 3/25/2017 12:30 PM, caihe wrote: > 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: Hi Caihe, Thank you for the patches. There are a few details to pay attention while sending patches, can you please check the contribution guide: http://dpdk.org/doc/guides/contributing/patches.html Most important piece, patch requires a signed-off-by tag: http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-body There is a DPDK IRC channel (#dpdk) on freenode irc servers, please feel free to ask there if you have any questions. Thanks, ferruh > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_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_dev *dev, > } > > list = rte_zmalloc("i40evf_del_mac_buffer", len, 0); > + if (!list) { > + PMD_DRV_LOG(ERR, "fail to alloc memory, abort execute command %s", > + add ? "OP_ADD_ETHER_ADDRESS" : "OP_DEL_ETHER_ADDRESS"); > + return; > + } > > for (i = begin; i < next_begin; i++) { > addr = &dev->data->mac_addrs[i]; > > Best Regards >