From patchwork Thu Dec 20 23:42:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10739687 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64E51746 for ; Thu, 20 Dec 2018 23:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 565F12895F for ; Thu, 20 Dec 2018 23:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A77128969; Thu, 20 Dec 2018 23:43:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33C6528968 for ; Thu, 20 Dec 2018 23:43:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731243AbeLTXnE (ORCPT ); Thu, 20 Dec 2018 18:43:04 -0500 Received: from mail-eopbgr140087.outbound.protection.outlook.com ([40.107.14.87]:1883 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729693AbeLTXnE (ORCPT ); Thu, 20 Dec 2018 18:43:04 -0500 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:X-MS-Exchange-SenderADCheck; bh=Bwexfeta4szi8BeYWEEumO1RQgaSwImTvF42wlvyWcA=; b=grSVDBxs4T378vljocFO0BdWDDDLGZTYwWe1FGTgN07iFS6lpuTR4ZhiTQ13EOONDuEk7I+oK3iyzIztugAcETzNoo5G4CdHU37945ZWkWLm5wSuzrMvnYU5Upnp1kCT08oeIxGaMRR4u/w9L/bPEil0EED2VfyqdnOFr/acAfQ= Received: from DB6PR0501MB2183.eurprd05.prod.outlook.com (10.168.55.140) by DB6PR0501MB2262.eurprd05.prod.outlook.com (10.168.56.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.18; Thu, 20 Dec 2018 23:42:57 +0000 Received: from DB6PR0501MB2183.eurprd05.prod.outlook.com ([fe80::95e9:6204:950c:76bf]) by DB6PR0501MB2183.eurprd05.prod.outlook.com ([fe80::95e9:6204:950c:76bf%7]) with mapi id 15.20.1446.020; Thu, 20 Dec 2018 23:42:57 +0000 From: Jason Gunthorpe To: "linux-rdma@vger.kernel.org" , Leon Romanovsky , Moni Shoua Subject: [PATCH] IB/mlx5: Fix missing destroy_workqueue on error unwind Thread-Topic: [PATCH] IB/mlx5: Fix missing destroy_workqueue on error unwind Thread-Index: AQHUmL28vhC3GcuGk0SuVXV7dYSpxg== Date: Thu, 20 Dec 2018 23:42:57 +0000 Message-ID: <20181220234251.GA26180@ziepe.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR20CA0011.namprd20.prod.outlook.com (2603:10b6:300:13d::21) To DB6PR0501MB2183.eurprd05.prod.outlook.com (2603:10a6:4:4b::12) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [174.3.196.123] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB6PR0501MB2262;6:kL6HApKq1VBIHMktqJogCwWEUVJPXRjpW7TlSditfvY3uN+2YqqV9ixPsTcua5AUtX7EIsf3zd3GCSNZUZsERv4y3jQXaQjgk0ebef7Jt1V2FXGn9ili5wnQA40xLHtQJZvHN/5s401eydHzCnF5czFd6mj3nHYWca/azeWVzH/CN+2nbZbxP2PX4OEW7vC2M/CNRei5/ofnr0lT59SmzbHpdHovibVpIAgFk/BR5wTk4gmVt2isgs8d8f1TdUvnXbmCA6K4OyFGmJ3wBDk71WbI3FT9P0VrNl+tSApEVggCNDx2O6Xc6qFmezTtjtVbmFN9wrJRHRvXH/AZCu7CUrtuXGKeTvCcxNtqMQ44C1HPaKA+JXgZZ/ILGM9KKMkS5qg9Z6UrXq1nBDtHzN3n67pNLM7VUEAExCQHzj94HZYGM0GJKQGaGephvr6iIS1wEicIYKg6XNhWH0RHROerRg==;5:Ch1U+pTtD2dzXc7bLMe75xT1/nvEDj6491ji/Q+XcrpddlSx4r7qQJwFQU/cIH/QUqcTMVxyz5PPwuHF40M51wcmXSEiDVQ8UptZXJIk2NFLYLhsWNHugI8RIni0GWUDRuoTFL7Bm/lVdkBYV7pXkLRjYiUF+rrQDUKU7YDG1NQ=;7:/WvzU2hpkh02ygOGsgtOcqzUABdP+RxherSOPwmTIuPyeAcUC2dx+WB8Oow5QOvBB63u0fbGOO8FxKvPBlptNcLZZKFIwAh/BqQCTJbXMOtTFaDw9wzTtVmIJv9xEue4oGlLuTMi/gVwKjQxFYip1A== x-ms-office365-filtering-correlation-id: 72d372e7-867a-4e88-634f-08d666d4de6c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB6PR0501MB2262; x-ms-traffictypediagnostic: DB6PR0501MB2262: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(2401047)(8121501046)(93006095)(93001095)(3231475)(944501520)(52105112)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:DB6PR0501MB2262;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0501MB2262; x-forefront-prvs: 0892FA9A88 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(199004)(189003)(2501003)(25786009)(6436002)(14444005)(8936002)(256004)(52116002)(14454004)(33656002)(2906002)(8676002)(476003)(486006)(81156014)(386003)(53936002)(6506007)(81166006)(110136005)(26005)(33896004)(316002)(97736004)(66066001)(186003)(102836004)(105586002)(6512007)(305945005)(9686003)(71200400001)(6636002)(71190400001)(36756003)(68736007)(6116002)(3846002)(1076003)(99286004)(478600001)(86362001)(106356001)(6486002)(5660300001)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0501MB2262;H:DB6PR0501MB2183.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ywfQRDMjCwaNNZIv2O7D9nWZkm+yoEG9XoJO5MfCNL2i1zKzIge9HnM/RV5X8O8ngY3ym4YrA1gQEKK3zrGnk2XUtmBcb3rZqTzgjRClmorot4G/hzaTW7HbxGZD+fZH0GJaz/8Mx5oM6oMV5Fxx+EOrS1tTUiizmygUF8JdoMCJzj4soSeG660WcF+bnOY1zEc2HNqEbNsme7lS+AuD6T4Hsn8OIPV2qhryB8FEym4l+Nl/qhVtOhzdp7rnerAnqkHHLAU5w2sTPqNX46C2dtwTz/e1XHH/cMHR+0QB0aTQ82AO0CwYSCegBOruVqBP spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72d372e7-867a-4e88-634f-08d666d4de6c X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2018 23:42:57.3331 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2262 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It got complicated because of the #ifdef. Fixes: 813e90b1aeaa ("IB/mlx5: Add advise_mr() support") Signed-off-by: Jason Gunthorpe Acked-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 9b40ec73cc646c..cefff6b05d6cc9 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -5779,8 +5779,10 @@ int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev) } err = init_srcu_struct(&dev->mr_srcu); - if (err) + if (err) { + destroy_workqueue(dev->advise_mr_wq); goto err_free_port; + } #endif return 0;