Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755816AbdIRLtT (ORCPT ); Mon, 18 Sep 2017 07:49:19 -0400 Received: from mail-eopbgr50074.outbound.protection.outlook.com ([40.107.5.74]:37760 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755785AbdIRLtP (ORCPT ); Mon, 18 Sep 2017 07:49:15 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonro@mellanox.com; Date: Mon, 18 Sep 2017 14:49:05 +0300 From: Leon Romanovsky To: Sudip Mukherjee Cc: Matan Barak , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH v2] IB/mlx5: fix debugfs cleanup Message-ID: <20170918114905.GF5788@mtr-leonro.local> References: <1505734128-21708-1-git-send-email-sudip.mukherjee@codethink.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5Mfx4RzfBqgnTE/w" Content-Disposition: inline In-Reply-To: <1505734128-21708-1-git-send-email-sudip.mukherjee@codethink.co.uk> User-Agent: Mutt/1.9.0 (2017-09-02) X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: DB6PR1001CA0020.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::30) To HE1PR0501MB1931.eurprd05.prod.outlook.com (2a01:111:e400:7b74::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 623d185a-279e-4aa4-7702-08d4fe8b4697 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR0501MB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HGt6+IAQiGSlKaot5MZgLJsiWW6gQ1kvMZ1+k0wzRpn7Cb7m8vvU3WjOGeoH9OZoRXauRhJ04p/+Zm14wtu5YR0GYfbiR0qcULvlcpBep+T1S1zWLNDWHFQhSKgyF/qNWvGI/Fcl0atyxO+5bzvMDihOfWuQretJKT0KQbtvRX1gsQEMPhaEWBPZOF7nrd++7iwoUAVdSrU0ZV+rjsOKT+/jt722mFeeBeuDlvgaZ+PPB37FGdDY/xuuAtOblgSaY99nbVvRvDinhEhutqlQx0/GpYgqcX8YPKYdaBslBliUcl9X4s/rKju1dPz9K/LZ8IyY7DT9yRhH0s4GxFrox4A0JhNUrWE7jrIJ0y16BQIgK6mtfQimIb8EyyERr/hv+i7nb25abr2n;4:R5QHnnKwzuHZsKdV+37NVDd3inrmwhbbVuAlV2E7syOWK4sJhdrXtPSrSeXIBL1Mmv5qAun+jjMVYDRfubE+wJP/BfemqyxHE6aJbgB5kQYeZCHjRzSq2rcuDzfOys9whR6jNhysueFY5iFEA6QDToPp+YbmAlim3rTo1T4mseU2nZKtmkzrDyR7tiQKJSrfgv/d6YwtFUDP78z/6C2F/d11sihjz0acz4qxk9ZirQ1hrw/OD+vnKLyTz8BGts5TP5sY8UTSTO55le4aRrHlKHQFR5XeJeU5NzpYTo4/6Do= X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0501MB1931;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0501MB1931; X-Forefront-PRVS: 04347F8039 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6069001)(6009001)(346002)(376002)(39860400002)(189002)(24454002)(199003)(110136004)(1076002)(7350300001)(478600001)(16526017)(33656002)(9686003)(4326008)(229853002)(5660300001)(66066001)(16586007)(58126008)(68736007)(316002)(2950100002)(105586002)(6916009)(83506001)(106356001)(6666003)(84326002)(21480400003)(3846002)(6116002)(6486002)(76506005)(7736002)(189998001)(2906002)(8676002)(101416001)(6246003)(53936002)(98436002)(25786009)(97736004)(6496005)(54906002)(76176999)(50986999)(54356999)(81166006)(81156014)(305945005)(86362001)(18370500001)(2700100001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0501MB1931;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR0501MB1931;23:iqfu/kNdyL5YNqZ6rYkMz1/dBJ9nsw5816v00wd?= =?us-ascii?Q?uVpuOOvR0fFwZZN0HDRATRnO/+j6TrtxfVIDRitLq6BtCh7duszFk54+RUMW?= =?us-ascii?Q?CWjtyv9Aupsu9m3q/9O7pfNYmlpL5br3nSMkbJmf+k8gqCJsxMqN/W5w4Dy/?= =?us-ascii?Q?mz+vHmRptYlXEfIPmvP45N/c22BZI/BhJWsICyNTHY0ZbpR2e8Ow6q4Kb+58?= =?us-ascii?Q?B4tkkBVp3Oy96Y3uF2FJoD73l3Op++YqPVU6GEiS8elll1xDEz0sb4GISpgp?= =?us-ascii?Q?yH0pv0lLnWxQFV+t75ouHFZ4HLcqk2CYnuTMf6wHRA36/x6cWzRatm393cTh?= =?us-ascii?Q?gPRKBf5jwFwJiB5x2uxHGCJvKtBS9N1cKnh9frb/YuGxtArKl46LXYwM1DAH?= =?us-ascii?Q?88GIl5X7QqyDSx57d5aj6JKssQC43WN9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7EyrPLc6DXeASe9DfJxd5XThhpGovQ92WdXm02otJ0Y/23kI?= =?us-ascii?Q?IuGxZCw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR0501MB1931;6:9P0Bm6JwJfFYYdRmI6fekeIRP9B3+wGCANgMrgiY+x6r4GG6aB9jmdDTRBhwfEUHz51HGpyFWPj6T/WrVvuUimxAINYWcdX0mbfLPjpRsPdumzPBnHW0F8a+tvhm75OT3g8rJ47KdjbvtlsEHzPoLbb5D/jaiZfZ7h8QHmnUZC8PVAQRJQIu+oYMhDTTrffyVZ/K83S/BOuzzNHYX6bJMKf4ekOWMGAnb3eTxfbMgHyO3pq9KmMLr6h2tej8QBEWTsn6vM5R7hjIq2i1/ntbnkwvWk8YNto6mriwRhIT95/UlULGk6RMfU/9sUn6Z+DBCSHgXg0JxXB1nx7qC9MaNA==;5:dsmsfVnjZRi9ShKFgmB7tnwjjGZmwb5CnIl7+tBJ4W+oRkYG9bCRDT4H6szRngboNjirNMM03gRpO+cj9/1VGIHl3DMYhX9W30UBy6RWnpYQyJZv7cNCKUi4weLot373rWvV4k7kVy5eF1jzh7J0NA==;24:QeNej+lTfEbx5wYl5AazWR9OH9+U4VoVatJ91u5hHx2OyP0SMt7zsVeJWPs7qS4EQtr+OU8/j5ZUHupCQcXDNSGwQUUTZlWm7FIdwNnLTng=;7:7nGAppzXklEYVTzJ6zHd1WDtLapRwbVhhauaLjmtWyneXXefVwblJ+51bMV9RdcZfMmJx39zL5xfnanXRp4csESXrqk4CebSHm1h3h2ffAMViVRpcbf6UMEMzj+rtENcGfAaZlYmUmUq4koiddaFA4CpXX3Tzll1EgLKYdOr+eKxQYGosgB3/EN5wbvx3rHbvrq5tvxKPhvdTWv+XtkuuDXcqw6FFX6Ii7+Me1TQHk0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2017 11:49:10.1041 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB1931 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2348 Lines: 63 --5Mfx4RzfBqgnTE/w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 18, 2017 at 12:28:48PM +0100, Sudip Mukherjee wrote: > From: Sudip Mukherjee > > If delay_drop_debugfs_init() fails in any of the operations to create > debugfs, it is calling delay_drop_debugfs_cleanup() as part of its > cleanup. But delay_drop_debugfs_cleanup() checks for 'dbg' and since > we have not yet pointed 'dbg' to the debugfs we need to cleanup, the > cleanup fails and we are left with stray debugfs elements and also a > memory leak. > > Fixes: 4a5fd5d2965c ("IB/mlx5: Add necessary delay drop assignment") > Signed-off-by: Sudip Mukherjee > --- > drivers/infiniband/hw/mlx5/main.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c > index ab3c562..05fb4bd 100644 > --- a/drivers/infiniband/hw/mlx5/main.c > +++ b/drivers/infiniband/hw/mlx5/main.c > @@ -3837,11 +3837,13 @@ static int delay_drop_debugfs_init(struct mlx5_ib_dev *dev) > if (!dbg) > return -ENOMEM; > > + dev->delay_drop.dbg = dbg; > + > dbg->dir_debugfs = > debugfs_create_dir("delay_drop", > dev->mdev->priv.dbg_root); > if (!dbg->dir_debugfs) > - return -ENOMEM; > + goto out_debugfs; > Thanks, Acked-by: Leon Romanovsky --5Mfx4RzfBqgnTE/w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAlm/srAACgkQ5GN7iDZy WKcJSw/+Kifbar0+QMPnfnhPUjRtyXNkm4V/RpSzEH4Kks3sKqVSuj3oLsH42enQ 4SOFVwKrm6RPQ3Q9Dl8rS255LhffGzv8brBhIwi32Ik0lDwjno2xTiwChJraJkco bSj7rhgz1mV4hVzChX4fBIzD5UE9mjJc+seWXk2YONcoopBHY6yIK2KtdMsWQEGP 9rHnCMWRDWzVAA7wY/xA6sZ4Wjn+UjkgsjG9zZuqe6SLQetnbNgqujEzQ7/TjXVr kCpT5qoMVIWIXou/1qiLz4ubpJ+favBTva9pzw7y+zts98ukXAHMIOKYcJlOS0p+ PRmNWNjl1CbXcePLgktwYSe5dvqHHp5xBLRhpls00ZP+vToXLjceATsQLWaAxP+p kfsdpGEqFcnZCFMXLhR0dmePBVY6KS09/ww9h2CippvQZm6FT+d7jnmfOcHoWw/B uZgqOm5vNiekZCGa/vTB/tcrGa41b8jyO1vYuwhTdXBtC7o8OXUNXymknBbbO+4F YRkMSVbXNVhUpqOVj9bnUCnwKyWcPf6TvGPkackuIdsjiMpScxCuJEmo1sU+mECw 87UxXtG65smD2FlYPRrfYmiSl2sLg4thL0DhpIvaJCWn+PFLfl4gfHsJjH+pnywN 3Dtyu135qbDCkosmWIsEkwwLjghjktCYGsPezwkel2Y2bBbZhPs= =2Xp/ -----END PGP SIGNATURE----- --5Mfx4RzfBqgnTE/w--