From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6B8C41E20 for ; Wed, 5 Apr 2017 17:34:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491406451; x=1522942451; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gcJTleFi4QWTe+ZyB9aV/phB8ws0lWRgTjml3Epb1WI=; b=UBHQaMfXIpZoHK6TsITvrzRGbzRUkQZdgZ6uRN8V9MLwAZK6y/5HS1N1 XgnM+49LZVdTQzSHbCp2PnaNgCmxtg==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2017 08:34:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,279,1486454400"; d="scan'208";a="84797513" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 05 Apr 2017 08:34:10 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 5 Apr 2017 08:34:10 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 5 Apr 2017 08:34:09 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Wed, 5 Apr 2017 23:34:08 +0800 From: "Zhang, Helin" To: henry CC: "dev@dpdk.org" , "Wu, Jingjing" , "zhoujingbin@huawei.com" Thread-Topic: [PATCH v3] net/i40e: fix return value check issue Thread-Index: AQHSrg9qTchNhkRs3UG66OA/BjF3U6G259rg Date: Wed, 5 Apr 2017 15:34:07 +0000 Message-ID: References: <1491398393-14200-1-git-send-email-caihe@huawei.com> In-Reply-To: <1491398393-14200-1-git-send-email-caihe@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 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 15:34:11 -0000 > -----Original Message----- > From: henry [mailto:caihe@huawei.com] > Sent: Wednesday, April 5, 2017 9:20 PM > To: Zhang, Helin > Cc: dev@dpdk.org; Wu, Jingjing; zhoujingbin@huawei.com; henry cai > Subject: [PATCH v3] net/i40e: fix return value check issue >=20 > From: henry cai >=20 > function i40evf_add_del_all_mac_addr without check return value of > rte_zmalloc >=20 > Fixes: 97ac72aa71a9 ("i40e: support setting VF MAC address ") >=20 > Signed-off-by: henry cai Acked-by: Helin Zhang > --- > drivers/net/i40e/i40e_ethdev_vf.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > 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_de= v > *dev, > } >=20 > list =3D rte_zmalloc("i40evf_del_mac_buffer", len, 0); > + if (!list) { > + PMD_DRV_LOG(ERR, "fail to allocate memory"); > + return; > + } >=20 > for (i =3D begin; i < next_begin; i++) { > addr =3D &dev->data->mac_addrs[i]; > -- > 1.8.3.1 >=20