From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0061.outbound.protection.outlook.com [104.47.0.61]) by dpdk.org (Postfix) with ESMTP id 9FCFD2D13; Mon, 7 May 2018 17:10:47 +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=I7ypPZGPV9ArXTD4/1Fy04cmtPhmPMAGL/20Xl1Wnk4=; b=k7laIs3L7d1FJfWGx2+N+Z3C8ue1Mmbd6IzgxuRYEbKgjlovcitHgaHxxunbDIjbVlfd9/CwRD9EBt8vv88zpOnreJ5wX3KEPFjzFDO7ol/A0OjjbBRS6Nqm5FakcS+Gv2DL31NE8UlgcMVoN3LY+oxwFx16AJ/cYbeDBaVI8xY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR05MB1257.eurprd05.prod.outlook.com (2a01:111:e400:5889::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Mon, 7 May 2018 15:10:44 +0000 From: Raslan Darawsheh To: shahafs@mellanox.com Cc: dev@dpdk.org, thomas@monjalon.net, ophirmu@mellanox.com, rasland@mellanox.com, stable@dpdk.org Date: Mon, 7 May 2018 18:10:32 +0300 Message-Id: <1525705833-8573-1-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1P195CA0036.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::25) To HE1PR05MB1257.eurprd05.prod.outlook.com (2a01:111:e400:5889::14) 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:HE1PR05MB1257; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1257; 3:lODsq0kTx95AdmyGDu/xiij8xbF6vGPDh600OtEvvd8048GjYWec4Z9C6hSLUM7ZEmJIpM/qaQ/S7799CickZ0gUDXppPoVdjHsaY4jEkStFkfTWY5y/csO8s6xam9+xOIknkP5lX2xw4vxRNltXiXkuDvS40nYpjoyQdwyiTYz8ADN9GZo7Sg25tNx04mG+CbwFA0nFPPByaAPfIFLXCVgqKXBlSYsqq2mEc5tDUXzcGANaDnnP6mTb3xodoefn; 25:RC+9B0oet/Y+JV55oLP4yQzG+JlBFEdT8EKLBJUKRDVDK8hG/9QjpkgEg4SVmHbFpL85vcso2QFZhJQ36TSYGAz6MF0QnQppj1+azZHuhat68ZtxmeYaplmjgczVS/WDqfxdB61AvNRwrBOacViQ97GPmqYlagWf+1I6k+Hhgdn4UmpchnrtP17z9yRQfSUL5pSIByaBZSaGcbBCO7a21lmz6t7doXZ1ofzx949+gS9Q/zNth5IC8rm+930uBf6vEPyT2h4lkyIeR7dfyVuJQi+EgX7e+pVza4hk4OPlvd7iyaz9f0cwYqXBH71ChOI+J78nqOKLYDsSaFsN8ntCgw==; 31:eOYcX0t74CmmWiLV/C1sCTj5mJtFKGeScNDl2Q1GJS/RspkWfoW85Qcxdu7QzCc3nOnXMFUWicGqZ86IIl8SAI6eTox52+sGeQyzdtjzUcY6dJma52QNa8/Zol3SS7TwR8fX2e7p3+x4GPZf5euyyr6tt6w9pR/S4TrNTFEXHqVXKpyBVeNwXpMYmSxUupMm5/XbtOORk+V2RStiMf8bEVHZMAIkvCyrtpWnMGKb/J0= X-MS-TrafficTypeDiagnostic: HE1PR05MB1257: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB1257; 20:d0gPYz+YrQ9q+5xUrab8ybZJkojG6fMxT0tV0ZwgftJSa3p3CQprHdltGYSvfHnIjIbvvOROkaz2fvpXh2jDUe/JWltHh6aa2A0G6hsTZASMeMt467DK/OrMFmwO2yGGB7SaKOvlaDia3WdYIgZ+4JN2T/bHtm2ytY6WSDf7WFzFSqqtPk1qq1JwtMjPaCWisAMi71wTFFPq7KslV0sFktV/Fm3YTYHEOrVoQdoMddH4+kbpt5boS9lHxCjqx/WgwqasWHThi5wfwBE4rsDGM0I4oKpND1HFe7up1J0189V+5zekKIeMd7JtOtSRn7vi4ia4DG/rVy1ne4p6Z19faVuNuRd1t9+0I6UTNORsMJvoaqhHXV0aMd9uylLUk3MY66m0FgUO7fLTi4cLZlEVTRgpxnSpktkX4rKDJmBT2yUcoxUF+K+ZQ9nwgJAtBz/IfGD/CMsyBx4omdH0LTwL5u/iy7xP4say9rfwBGSshld6JZZxFj2qLX+1bwWHup96; 4:R88InuFpN84oJaP6Jhyay/O7BntbHAVNazhh9wmKUH0ndUeVAd8U8V1vp6hcGufeP+c1HWYM94Xn/RLh6Crv28Vk3PkZ9Wbhy5aj4FY055rz4S6Van/ble0yMa1AMSnJ3dmt7kwdkW/QIfMbemOGOJfWQN18o9gMF5/7HFF6l7T7FIKskWnwgALHDC5OOqsgjIzCLd5P+aejkMAAA+2/HMjQYDIAbi+9UPItZN7QYQIVmoEDf4dKBaR0kK1uoPOdGWOTJgYGIIgmT9GpeS38Ng== 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)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR05MB1257; BCL:0; PCL:0; RULEID:; SRVR:HE1PR05MB1257; X-Forefront-PRVS: 066517B35B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(39860400002)(396003)(366004)(376002)(199004)(189003)(50466002)(86362001)(36756003)(69596002)(5660300001)(66066001)(21086003)(25786009)(105586002)(47776003)(106356001)(4326008)(6116002)(3846002)(48376002)(6666003)(6636002)(305945005)(97736004)(51416003)(2361001)(33026002)(2351001)(34206002)(7696005)(52116002)(16526019)(26005)(59450400001)(55016002)(486006)(476003)(2616005)(956004)(16586007)(316002)(37006003)(8936002)(50226002)(8676002)(81166006)(81156014)(68736007)(478600001)(7736002)(2906002)(386003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB1257; H:mellanox.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-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR05MB1257; 23:gxujPGB4Uh0aSfIcT0hqHhXjeQKZB87dSEMih14Up?= =?us-ascii?Q?mjEoVscBOdgCssarM6PRKG7JmPCJfjg3LtSHVmBKvhkdiraMI+yPuYIrR7CC?= =?us-ascii?Q?fUZ49B2ENUTS07Fd0BfSGikWCjv7Yo6Qg/HMx0mQZBdhT4SWv3t5F/I9KCu8?= =?us-ascii?Q?2DI8LAS1dg6qF14PJ09qJKk9SE+jWJBdDiCXpndasazL231/rWXwc7a3BnQP?= =?us-ascii?Q?eWNPHTgbGl542svlRpm2744XU2yyD0RUdU1HMEMz2UzN+a7xOoQx8CxbS3sV?= =?us-ascii?Q?J8qsu1+87E9uXV56JdjPCi2rNeQ83BYrQplvuLZC8LHuXLA7hVlWwpEls3v5?= =?us-ascii?Q?By3OIjOdq/Oo4yFHRtdrsQl/De6UbTVBH0k/X5DFkBxhsnpsGxlweCSiU+OQ?= =?us-ascii?Q?J7lEdLSmgAls25QqnFKwAPiqxE9OfklRTns2Z4p229tHxUgzB6EaXKi7oGWb?= =?us-ascii?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fEvz+0uhyyaaJr4CUYOrur9JLAjitzdfKk+lr0e2h2c0dtEeXZWu3myPR1ucqZpnoNIZObi9HzmJbo/hWQfBLIrZF187zxfWlsdcPGaYHHChU/ig98/FqPquGbPm7Iqg0XUdtsGSpyrm6Eq8uah8xuwp0VtdZBOgwbSYhX/j8eeq55Tu0+gFK7uJ5kRSZofx4InBz0robS/1tZ982 X-MS-Office365-Filtering-Correlation-Id: 3f882039-cfc2-4293-cb2b-08d5b42cb563 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2018 15:10:44.6007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f882039-cfc2-4293-cb2b-08d5b42cb563 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB1257 Subject: [dpdk-dev] [PATCH v2 1/2] net/mlx5: fix multiple free issue when attr ctx is NULL 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: Mon, 07 May 2018 15:10:47 -0000 When attr_ctx is NULL it will attempt to free the list of devices twice. Avoid double freeing the list by directly going to error handling. Fixes: 771fa900 ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters") Cc: stable@dpdk.org Signed-off-by: Raslan Darawsheh --- v2 changes: Better handle for switch statement. Reword the commit log. --- --- drivers/net/mlx5/mlx5.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 5190b9f..3831e3d 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -690,18 +690,18 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, break; } if (attr_ctx == NULL) { - mlx5_glue->free_device_list(list); switch (err) { case 0: DRV_LOG(ERR, "cannot access device, is mlx5_ib loaded?"); err = ENODEV; - goto error; + break; case EINVAL: DRV_LOG(ERR, "cannot use device, are drivers up to date?"); - goto error; + break; } + goto error; } ibv_dev = list[i]; DRV_LOG(DEBUG, "device opened"); -- 2.7.4