From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40069.outbound.protection.outlook.com [40.107.4.69]) by dpdk.org (Postfix) with ESMTP id 8A3026D3B; Tue, 8 May 2018 11:11:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TONpeUGXodu/g8iNWX5xoIgOh0x1dFTaoONSOLb4WgY=; b=bklc+Pb/Kb3FDOcswhLn1FEToMWzfWs9/J/IElFia1ccUI4xJBxtoubf9IrKDE+bsImXwpOF7tf8dC3uqPRrGfYpEqYBTPKW2GWvw5ulC3lJw69YLGLSsnVJUeTjV2baNDZDHAUf3rj0kzFDzIXb/U9E0VarcEeK2LAXgJi7J0Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR05MB1259.eurprd05.prod.outlook.com (2a01:111:e400:588a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Tue, 8 May 2018 09:11:43 +0000 From: Raslan Darawsheh To: shahafs@mellanox.com Cc: dev@dpdk.org, thomas@monjalon.net, ophirmu@mellanox.com, rasland@mellanox.com, yskoh@mellanox.com, stable@dpdk.org Date: Tue, 8 May 2018 12:11:27 +0300 Message-Id: <1525770687-22980-2-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525770687-22980-1-git-send-email-rasland@mellanox.com> References: <1525770687-22980-1-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1P194CA0047.EURP194.PROD.OUTLOOK.COM (2603:10a6:803:3c::36) To HE1PR05MB1259.eurprd05.prod.outlook.com (2a01:111:e400:588a::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:HE1PR05MB1259; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 3:QPrrGam4eVrq82GoqDfmOQtHsHln3X9YKR+NamYhE84TcqHizDPu+nGjE7N4AMMeu+5ezF6A6XJ1HIUBiTvmPkU1rr20LLPRH/Yt9ZWtWdav6fCJVjzvxwLBPR/KfU2NIQE04L6O1HtW2apU50rKwiWkn+KWOmO8Ko+qliYxp+XjISeIGEtiS1J3agdw7mbeuAZjw8mwFwTFXi4kz6zw/Su9JEO+nfM0Eqj5lnF/k+4vEAMpp6E9koFrDAAM5Wmg; 25:Eo5NBbnPUim4VUdxbn03PDmtHX8mrQ+MoWQdByMYZj6/WBlh/dbl0N15kkiGM+kYMvlbXX75Vz2EWE92J5FHUF0ma1dLyKh+LLGXErx8uIAokEAafsTubHJ6Vl7V2C/70YgVMe7EfTdki74H5k57vOphJAgoN2KQVDR9NgR5H6JZcvwc0jdPeIjf+enaZIPPsvBylBfmINbQmd0nhbQHCmHYR+GBoS9k1E0Ho27+7XQwnwfC1SttCDxiqJxboONBEFeZi/tka1Ulwbq0x8kSthOA4/NCrvO7yMLBK6zsPm5Jdt0odwMvb5mOhP0lUd/VNaeqz/s2HgMALdL1uEdGmg==; 31:1kj6XjC/VTB5CTbd7PfiMGwXEJwhnVoA0Lxl9nu+mv55EXQZWZvPwrjD7W1mJBliqCKgBUlHSq5nAoMH4hRAvvrnlqucYdBxrQh0FZx3Fzm26zhRW7uZbv6J2qhRHAtctsfXVeZVk3yLp51cFIbgepwLC1ojlzeV3xJ8D0LwrPAEELHIytG2s4WLx9+g0HAn4u1ZwR8VwLIrWL+QKlXi4pydElzCV6p7LcO6jWVxShQ= X-MS-TrafficTypeDiagnostic: HE1PR05MB1259: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 20:+TIYDgcMbLeqHE5P9wFagO3nWPixaTtSoTCU/D3o6cSQ08bHwHbatrsSB5dKw6RQfc+cXOMISM6ye/NUypME+4vka6+FLwdnU/jbH0z+zXgcHOuDnwK0W3Nn9SblnjB6rbKyY5SKMXIm2dPJLM8sMdLNh+MMTLKykY6+WYE8YkTdN+doOTcHNqVTx7cYXTmEQdmP24UXpuTHqJ3JI029xBE07z3gN73cyUBg8jIj3lXfmcJIR0ecksifgX1z+eH1ruNEC9nYVQJv5k3kHKvT1+BYsM+q4t1Qoaih0Z7cr2JZJWf3R1imjHJuneEo4YBCcw7UxCjQ9zgDDOAXmf969hy8O0glvVXnFekZ6vkCmS++GfWlxypqqi1w5EiQ7OkDewXUSF2Xk7dCGST+kQwrWLchjYY36MywZ3euwQDd7zBXJPhc/Ghi9eiuiDqVAc1rYwYSqAao3Moel6gET64TCLOymeppXWGEZfdcwUEyrr91JHf55i1DJHg8xaeCQb7a; 4:lGhFh/P8C1GTRxz1lUH5GqOyp2F4Xa5Hl29jR7yDdDY9B4OCYe1+vkpuycfoy5B8C5MuA8fyTo9NGSeQ/sqOEyBd7UdcEffB73AFAamiQp7FwdQT7lUXxjS8omJ0iE9qtztNY5Fm/MFB4csPS/9loPrdwhbP2NB8N6k9OIdHzrhCZ4roL+VIXVat4hilf4g2GiQfqDpOLEnjhzmmo8SlJwQea/RjBkYQ/LyhQfPWxoC5krxENFRLgoi8WuNnTpAd7r31falX54+wlhyBwAtm8w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:HE1PR05MB1259; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1259; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(396003)(39380400002)(376002)(189003)(199004)(50226002)(956004)(476003)(7696005)(81156014)(68736007)(51416003)(8676002)(86362001)(53936002)(8936002)(2616005)(66066001)(55016002)(16526019)(97736004)(446003)(486006)(11346002)(105586002)(4326008)(7736002)(81166006)(52116002)(33026002)(25786009)(478600001)(34206002)(76176011)(6116002)(47776003)(2906002)(21086003)(3846002)(2351001)(386003)(59450400001)(26005)(6636002)(6666003)(48376002)(50466002)(5660300001)(2361001)(16586007)(37006003)(36756003)(316002)(305945005)(106356001)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1259; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR05MB1259; 23:tR79QSTkN0D5VZX9zYYvgmRS8hOzJWhtrjKBRdx2s?= =?us-ascii?Q?9lMH1dB0DaKawOh/o+imnbutrynvgkQnUNawYV3BlTJ6yTApKgKUApwvvl9J?= =?us-ascii?Q?XnRX60YRuDcDoWRUTWQA6Y7HtI3s0pCScFiMCFRyW6wclIdyUF6WTkt9C5Ez?= =?us-ascii?Q?0scU0EuFv37ns/IEfK7PQzdM4MrGmrYqZNA3TNsjdddfewO9YUzHJ6nXjd5Y?= =?us-ascii?Q?XI9U2LDFf2LyDlUh/GSkXutYUAf6p1VtLkXizfImwmQezCogtLmkH70JISdx?= =?us-ascii?Q?ZDNg/iUmJ8+tIPPVQujxcHMGbuxGEFeaIrjeEeRsmcC4FlDPYbZs/gKWIaK2?= =?us-ascii?Q?SF/a7JgwNZSXj7zsGIZL7c4aZOKJG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VhYkp2LKbU0f/hNGf8qnqtfMauhpNS8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1259; 7:MnkbtXWI4B7K0pCBom1qxYe+9EanQ1tZWDtZuYjpgYvbjdLDLfl0qB4SVI8mX5mcFE0ouzNNP8SlP2yECDjAjfIg9Ii4dR2V/2PgbdxlVApcNeE4GrRKS629ME7SPGlMF8EBHGMXhcsPIsZT14Zdd/teZTqf6FZ9oL3RMiNPwIIes3zafJxyOFyCGdR6pKi42k3KN2BCFceUARKtjc7JNGR6H8pTvzp6w69m3JKiBi8X06xt3Svd5TBEnBDEKv9X X-MS-Office365-Filtering-Correlation-Id: 3faf1247-4941-44e5-7e7b-08d5b4c3b841 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 09:11:43.2590 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3faf1247-4941-44e5-7e7b-08d5b4c3b841 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1259 Subject: [dpdk-dev] [PATCH v3 2/2] net/mlx5: fix resource leak in case of error 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, 08 May 2018 09:11:46 -0000 If something went wrong in mlx5 pci prop the allocated eth dev will cause a memory leak. This commit release the eth dev that was previously allocated. Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh --- v2 changes: Reword the commit log. v3 changes: Reword the commit log. change the release to be only in primary process. --- --- drivers/net/mlx5/mlx5.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3831e3d..c4ab166 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1063,6 +1063,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, claim_zero(mlx5_glue->dealloc_pd(pd)); if (ctx) claim_zero(mlx5_glue->close_device(ctx)); + if (eth_dev && rte_eal_process_type() == RTE_PROC_PRIMARY) + rte_eth_dev_release_port(eth_dev); break; } /* -- 2.7.4