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 E3021A0C40; Thu, 29 Jul 2021 08:50:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C98E40DFB; Thu, 29 Jul 2021 08:50:43 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2047.outbound.protection.outlook.com [40.107.93.47]) by mails.dpdk.org (Postfix) with ESMTP id 0FAC740687; Thu, 29 Jul 2021 08:50:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zcu9aUs0RUQAZEOIIn6JFMNL9W39IFS3RuLnMizL5FtxF7eUTl2OrEYV0k8yTE+h7twNGk15TBmCewjJm8ULMoj7TzlpN1Qt/RyhXR8YyB/FzNhC3wgfxEtbhe73f2v5j547SH1LTlFESVZEiwmXTzrTP+w1KovB6KNiL64M2f8pJtC3cwzncQjZH6DW+4OvkVblQ7lzS7iXqcJdFQOmqjWxhnjMiw0Wri6SX0+L9HG1D7pyujvIR+EqboX+uYXe6ipGOmvVzRji/6QqinGgsgbzo4RS95fn2+sBr/c5/Vjs/W+pFM2fOs7n8cGe9xkc30SvhnfLMdECSV+33ocAbA== 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=/9q4l82TpRGRqKE0Gce6xf/8y47KOon4U88xFs+eLzk=; b=NTpJtxtKalHD4Igaa8Hc4pPrSD905v1ypstfaexZYwYFwkHRzydOaVOloMCwPb/9ehDWGWduzue8oREf8n/BmoUBFRlEov+n+kzxZoJjBSjIs5iZkxoNc4gDwdZrzpgWLZmROzSSINff9GnBEl1QhrcgcQJySE02q7anY0d91X4SbXxoP+ENIa8MaO+67JQSl03Ssq1uxNmLFgQ5gNb899hdKUgBWfOleqn/5PoNOJDN3E8CmnApy3F2iKYPpd4JZiqPlTQrviE6IywY4pRjXGTXw/1JVrEtiydV6FPIdMZ++cRK5tSQf4atCmcT7daAYD9fTABPaWA9geLmsZ5ukA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/9q4l82TpRGRqKE0Gce6xf/8y47KOon4U88xFs+eLzk=; b=Ew7r1ogvV+oC2arcslQZQIEjptbkOGwbszI3D0uxG3YOTbpad6uTG36PiF9uwcS4Ie6ye4SRbAFXRB8MkbUfLZ1UKgsjgOz89hbRg8VwNc8tdv6ZQ0pAsAu1H91sMB2ZUwRGZvBNL/HQgNukuGDE4SIciLwokACd0iMtVG9OFSspNlUinDScSEv4X0X9ua44m17zQoQ5GhZD7DIfCVDyaRP+7U0ANis7P6ZazNfr6j12jF9jcE4t0QYPiazCJqcQMMd+7jJdS4QtwM261sAMttxbDtv8iuQnekx9yWdL6/fk0xtlpf/XlOl2fsqwSLU2DNx+fNuEmXpi8+3bb4iinw== Received: from CO2PR04CA0112.namprd04.prod.outlook.com (2603:10b6:104:7::14) by BL0PR12MB4706.namprd12.prod.outlook.com (2603:10b6:208:82::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Thu, 29 Jul 2021 06:50:40 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:104:7:cafe::75) by CO2PR04CA0112.outlook.office365.com (2603:10b6:104:7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Thu, 29 Jul 2021 06:50:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4373.18 via Frontend Transport; Thu, 29 Jul 2021 06:50:40 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 29 Jul 2021 06:50:38 +0000 From: Michael Baum To: CC: Matan Azrad , Date: Thu, 29 Jul 2021 09:50:00 +0300 Message-ID: <20210729065000.172793-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 81cfcf6e-0a80-41e9-671c-08d9525d2dee X-MS-TrafficTypeDiagnostic: BL0PR12MB4706: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1824; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M81yyy1H8AsPj/0f6rCeaa7Dxyjc43BlceiDHjqWVwmzWBSyfMzzkZMmV3WKItX31rvfmz/+J1jRNNbWODuYOt3Aqs4K4bFmZxosi7nym3eiCzgBth6Gc450VAjHQ/Vo81U+FFq1Lrqrv//XLzsaAh61M5oh183zqQjGl9YD5VW91FRM0Ue9kSeJBbV6SGVEoHC9e4qMaWkdmwkNTezBBqKDQvxHz5HXWWSgec5TSYAY9yRDRK3gVc+pWAsAOPMNSDsow9SCMyXikjG568OU9x+5SwPCG3bENKc7H9FFA0f8JhSqX0k6yWiMmBJdQnSZuyVcdOKrnb8t4LPCfQQbICMgObUPMtFzo64tnq+9YFv3cfs8dyrHH2uhhuQZszcTNmIVIyvMy63NbNAND5bRDGrWAkTNgcI6QMhNDoYUX0YU+NBqUjwMbkJsLYNIrEzGquqVCUeoYPRhWRHFtDjauI8f5oWyKD8eBawv3kBDtMHpQXAv2hC2IJPuR5+7npFjRh08Zqx+YTcl/Vy5k+aqGBdXHE5tbzgR7X0wBuJ4v84xSpGm1LGHMsoS1VxzgtiqXpxO3UhOptoo20/V6X2skFWsdwDmaLU+SEhNd9E0Hu0dn4hT9DyVyPGkLJI+xVE6gUYlGLPMTSWCA6QFc1vbopMGH3+0NZQuUKQbZkAAslYqZmUYN3gAd/10lbV3QapKMRAnodO0buNbG7JyX5j4Ew== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(6286002)(7696005)(1076003)(450100002)(6666004)(426003)(36756003)(26005)(55016002)(5660300002)(2616005)(86362001)(4326008)(82310400003)(6916009)(47076005)(508600001)(7636003)(16526019)(54906003)(83380400001)(36906005)(8936002)(356005)(186003)(2906002)(36860700001)(8676002)(70586007)(70206006)(336012)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2021 06:50:40.4591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 81cfcf6e-0a80-41e9-671c-08d9525d2dee X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4706 Subject: [dpdk-dev] [PATCH] crypto/mlx5: fix driver probing error flow 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" In crypto driver probing, there are two validations after context allocation. When one of them fails, the context structure was not freed what caused a memory leak. Free it. Fixes: debb27ea3442 ("crypto/mlx5: create login object using DevX") Fixes: e8db4413cba5 ("crypto/mlx5: add keytag configuration") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/crypto/mlx5/mlx5_crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index ea734f4d5c..b3d5200ca3 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -1021,12 +1021,14 @@ mlx5_crypto_dev_probe(struct rte_device *dev) ret = mlx5_crypto_parse_devargs(dev->devargs, &devarg_prms); if (ret) { DRV_LOG(ERR, "Failed to parse devargs."); + claim_zero(mlx5_glue->close_device(ctx)); return -rte_errno; } login = mlx5_devx_cmd_create_crypto_login_obj(ctx, &devarg_prms.login_attr); if (login == NULL) { DRV_LOG(ERR, "Failed to configure login."); + claim_zero(mlx5_glue->close_device(ctx)); return -rte_errno; } crypto_dev = rte_cryptodev_pmd_create(ibv->name, dev, -- 2.25.1