From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0B1E7A0C53; Wed, 1 Sep 2021 08:26:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFB3040698; Wed, 1 Sep 2021 08:26:02 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id AD09A40698; Wed, 1 Sep 2021 08:26:00 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10093"; a="198881574" X-IronPort-AV: E=Sophos;i="5.84,368,1620716400"; d="scan'208";a="198881574" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2021 23:25:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,368,1620716400"; d="scan'208";a="428458880" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 31 Aug 2021 23:25:59 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 31 Aug 2021 23:25:58 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Tue, 31 Aug 2021 23:25:58 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Tue, 31 Aug 2021 23:25:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IL7OlVhhrbE2sbxxZ3GdNllIt7z715BnWR6kQGs5gBuDzf/O4A8O9hEnTuONqLFjEVEapR5LTd5Ct8sGRJsxEBJ44xDW5mGb2OgLEfxUMC1RT6bk6Pifmuxj6YhiaGnuvUTsvgLNl82lFyxl3+WLlyjABi5IJVS8dUv8mvo0Eed7SYvvf4vXSx5wEf1gBR12zQXijnpwuftex2cohjnTqnVHx1N6R5hTIDui1pKJwjLYSIv33slnX17B8gcio0NclC3VaXE+ugC9xCU0yty5Ga+wM572KsLAQuomv67kvIDRPZLug+EsYxEV306fY9i/56dSnIq8pksSlnP0CQxcvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uP2x/QpT2FnJnF+TQ4Twt3hoi0j31VvmP2KKESWyl9Q=; b=lczI3u2F/2sZkvBD5dIOX2pIKzkxfoceRpP/uYkuJGHp5lhh037EQTuePin6CNf74JlLiFWS9adPFuqWLztqVIURGoyyR6FkmHPynhKT/blV9kjvslH+Q6sJI3K4omFUb0VlGzpwfCrxLfz57lJrFdcWB81gJMGxj09fP2CZy5vYjHZpfXUsDq5P13aZH6B9bb9U+1RpvZ/5xjK798amvQWYScEY2yobOaIdfUgwoTtOnRrUX/FiNum6DVt4XXxhTQ4QckKoLoasBgnNnDT3856nGYtiZ7NT4BH0tvxaF2Og6nXzyBe+XblvtqAUW0C0WmWHEJzbm5NT4EhxqhssLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uP2x/QpT2FnJnF+TQ4Twt3hoi0j31VvmP2KKESWyl9Q=; b=wgxr82di+YvlGysEhnZX56WyX6xnoSBJirqyQLGLdOXUEC+3/xXL+ZUtShBiU3n6MJPqYHoYFQoownTfmFBIzYRyG7D7yHuexngdUcgx4gNi/LdBijD3zVsd8zAibcaZUvo1NNuV4pHUZlCNOdE7M26XNzfvEM8k8ptXg80TyHY= Received: from BYAPR11MB3800.namprd11.prod.outlook.com (2603:10b6:a03:f5::21) by BYAPR11MB2646.namprd11.prod.outlook.com (2603:10b6:a02:c6::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.23; Wed, 1 Sep 2021 06:25:57 +0000 Received: from BYAPR11MB3800.namprd11.prod.outlook.com ([fe80::a451:601e:78:1543]) by BYAPR11MB3800.namprd11.prod.outlook.com ([fe80::a451:601e:78:1543%2]) with mapi id 15.20.4457.024; Wed, 1 Sep 2021 06:25:57 +0000 From: "Wang, Haiyue" To: Qiming Chen , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH v2] net/ixgbe: fix mac resourece leak Thread-Index: AQHXnnOgAGLLTjwSDkKm0aMhG4j+16uOtqiA Date: Wed, 1 Sep 2021 06:25:57 +0000 Message-ID: References: <20210831135746.8639-1-chenqiming_huawei@163.com> <20210831142131.9295-1-chenqiming_huawei@163.com> In-Reply-To: <20210831142131.9295-1-chenqiming_huawei@163.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: 163.com; dkim=none (message not signed) header.d=none;163.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: eeff7de0-fc9d-489f-ab3c-08d96d115bf6 x-ms-traffictypediagnostic: BYAPR11MB2646: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0UHbi4lhLfKjR3fX1IOnmcud/PL19kfQDk7SM+u4A3fg/z4babl+U85s2IM8ucXaAjeHC/0ruyw+wI75UbR15X0Sl0ceOYtHQvRlEQjTlCeymhDHytBQu15En+LiQ/WAu+VbZ1PkGykLvGDVewZNfv+t7Mb1DGWiGzKAodVTzGD/jL0daEnGqIOfjHHnnp2HrpCEf3+xQtHX4c0WyqKYjT9C1+bhZTIhBQgDHA6QpVP9bafmvhve2q+6C4EozF8AMFyfdTn4jGz5GVtmbzcP2zqCKp5l7Qp0Ix/BgR72J9W7PloK5dpWx32+AGstSkOvcm0DjcSI28cerb+av7jylaWgcgJLsmBBYe2yUQ/+kTQA7tZP+JqipMk9aZtwM8wwmw/8IQSuH8JwYCNHYPNPyz2Ym4b2qSEN5beNzC60kgaV/EtoIsSO4xmfjHKZaoHfP08wXIhnO06rXc1t/5kFKSV2OyMRCtjzVBgY8La/cWWtzxlGvGn3wu64HYEemC9Q5c2u8SaaiLpNMmy9aC/b9GEfoiPkD0HcyvYDghE503YyEnd2MsyWVidWnLoe8k4ipTzRd8qcrNW7P/96ic58rZXMcyyBr9AEHx8pkG5mQrnIBDyEniMSkaGyBr2o2nidfFgBVucAixd6PusGtsOgMO22L7Whq1fXYlXTLBDBDWlyE2ulL5KHgACriLBA3o7767p0izloBi7shEunQPVjQA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3800.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8676002)(316002)(86362001)(8936002)(52536014)(7696005)(5660300002)(4326008)(9686003)(66446008)(76116006)(64756008)(110136005)(66556008)(66476007)(66946007)(26005)(71200400001)(53546011)(6506007)(2906002)(38100700002)(508600001)(122000001)(33656002)(55016002)(38070700005)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BJVM/2K72v54a3Mw3oRypsQr5sc/fQXlZ3260aWTd1PRI/kMrm0AU/vOXjxU?= =?us-ascii?Q?cKQEnBBfOxAP2GLiprQ2u3r4bJ3AnmlkvnIPPrndmvy2tzKxDhGkQY7VdTzL?= =?us-ascii?Q?Jx3s7ityqnkDLVAiQQK3DvbbQE/EDhsNQ1IfFT8tUmiVv7YEYGhyomTitrlk?= =?us-ascii?Q?NNfpokw2vkheXGFdYDF/7uV3sFJtvfv4wfNdgVVZQjeGZDrVbnNe8prNpdOt?= =?us-ascii?Q?n1S4AQ7/E9dnfFFOrPL48icHSfr6bLmi81mmM6yIrY6wSaIw/MgUxKpKMcLF?= =?us-ascii?Q?Ll5RTGct9dQ/r6uQWzk60C9cXFNMu3EUu4m4yzRs2D286JBLFTBbOMuee5wI?= =?us-ascii?Q?GAXgMGwMqs57ZCAo/VdVgJNOg508kGbgNLyXuadc85vvA/aB5mNs/oVoUW4k?= =?us-ascii?Q?KW7NB+7SDMNXJkvToUemZ9S+Ei0tIZm03W/KJTYAfk2Tg68PLTFffhQvdhO5?= =?us-ascii?Q?p2UanCgW5rh2mnvP/gnqGHuJVYhaa4DTv53nDSEZ7OSkyty1LR8gi+aPF7mj?= =?us-ascii?Q?RcHWFpa+MzAuYWvjDXDIZ5PkrI5e9gjOmmyhDfmm8VVyYH9roMz9+MXhVnMU?= =?us-ascii?Q?HY/X1McVRGZqO5aVgg+owSa9TiYmwP8msW2/ooiU+ovTD3hVSx3HPWFRdL12?= =?us-ascii?Q?Zi0FcT/rzYXIV6cvyfbjGk48AKqm4GQqfHxeq4y8AOSH0qNMMQ7EMaPH8Kln?= =?us-ascii?Q?mhX2FTL47QD0BaPcE3Bnfp3XbMwIK32mubx+GM1yUFglhzNR+6436YmJxf5t?= =?us-ascii?Q?UmELsHwmJ4cV35fHghBgAYLC0gMsEry8L+YtOKgoabKpGf4Z/KkzYVwx/N0P?= =?us-ascii?Q?QUI5/Zo4M+RaMg1kTKLv3X0lT2Soozp3N8gpmR7eRLG09fV6yrP6fA2DpWXL?= =?us-ascii?Q?uceozfV6sZlk0RnPqL0rbCThqEC3hNGnZCQpfIw26hWKS4qvj0mloOO7oGwz?= =?us-ascii?Q?g23NoqXV+lvwJxrEAvtMEOhJ2mMGsTc0QRMw1RH+IHWuI2/G0VTxD7O24+UK?= =?us-ascii?Q?16iL4iLpJF9eL/E3BV7aY4nRC78eL/Z6vs8L/MlX/cr5ne+W5haVtwW2AVj3?= =?us-ascii?Q?MnPwKITnMB0VHFSjjY/N93yUp2fcpIKYwmhksXydNpUAwr+G/peiPGL83da2?= =?us-ascii?Q?x7ofQeIdAAx4PKH01HZkKAP9AMb0jMiz7dc4mrHfdYjHv1Y/COpTkbicUOwv?= =?us-ascii?Q?6mWMKZM/dotxDCLE3/YWsoct4K76vFT1jk4yY4PZ2g8WySgvMzJPIkuQilzk?= =?us-ascii?Q?T5y77Fgo6PuZXfo6VLkBKCr5D4r6SYH+oJqzO/2E9IEpL/UmWKfnAjPPnTyl?= =?us-ascii?Q?+U0wg2qWYLBRJkEnwg0LuAQD?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3800.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eeff7de0-fc9d-489f-ab3c-08d96d115bf6 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Sep 2021 06:25:57.2500 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jf6gSVPTCZTvkp4BZAERZgB6NaWpLCZQXh8Z0SNrj5AE4p2ZcLzOTu7H4HEp29qFvo7udJCxcBBbqqQn0boj0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2646 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix mac resourece leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Qiming Chen > Sent: Tuesday, August 31, 2021 22:22 > To: dev@dpdk.org > Cc: Wang, Haiyue ; Qiming Chen ; stable@dpdk.org > Subject: [PATCH v2] net/ixgbe: fix mac resourece leak >=20 > In the eth_ixgbevf_dev_init and eth_ixgbe_dev_init functions, memory is > allocated for the MAC address, and the address is stored in the > eth_dev->data->mac_addrs member variable. If the subsequent function is > abnormal, you need to use the rte_free function to release the MAC > address memory. >=20 > Fixes: abf7275bbaa2 ("ixgbe: move to drivers/net/") Use this tag: Fixes: af75078fece3 ("first public release") Also, your ixgbe series fixes can be into patch set, no need to send them one by one. Thanks for your effort. ;-) > Cc: stable@dpdk.org >=20 > Signed-off-by: Qiming Chen > --- > v2: > Clear coding style warning. > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_e= thdev.c > index 7d3a821300..6a91f104e1 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -1218,6 +1218,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, voi= d *init_params __rte_unused) > PMD_INIT_LOG(ERR, > "Failed to allocate %d bytes needed to store MAC addresses", > RTE_ETHER_ADDR_LEN * IXGBE_VMDQ_NUM_UC_MAC); > + rte_free(eth_dev->data->mac_addrs); > + eth_dev->data->mac_addrs =3D NULL; > return -ENOMEM; > } >=20 > @@ -1672,6 +1674,8 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) >=20 > default: > PMD_INIT_LOG(ERR, "VF Initialization Failure: %d", diag); > + rte_free(eth_dev->data->mac_addrs); > + eth_dev->data->mac_addrs =3D NULL; > return -EIO; > } >=20 > -- > 2.30.1.windows.1