From patchwork Thu Apr 7 07:07:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12804506 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62994C433FE for ; Thu, 7 Apr 2022 07:07:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235444AbiDGHJq (ORCPT ); Thu, 7 Apr 2022 03:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231528AbiDGHJo (ORCPT ); Thu, 7 Apr 2022 03:09:44 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC13B12AEA for ; Thu, 7 Apr 2022 00:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=STLaZ6u5JfZyBuciYHu7Cuv3k+HaAmpMAPPU4xvGd/UqPtEQjwaIPCkS2FtcHWxI+NBA5GJIN+6o2ZSJ6+BcDwPs2wqCt6OaEI2g+sZFxVV+BxTURE+niLYeNbYjgefporVKx3L8ixbsqx84Hty+PXZ50eVDZhLWgYBLqJmjojUkftjpH/TLb2PvvhgftQC0Z4f4zNpRVHbrwEqUcazd6F6rRXytAuyeUuXvL+vlEFvHHdLS5DLI/pPmQz8OJERSoRQeRFJY2/fG0TdL1PWewdmMFJaBjrYobUVabOF9LSPkeU9BjO6JkXSQsEcKaVS6ko15eWYsCOiV7sDVtB3hVg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WPhFq69eXbgglHblkGsyHzButn+qvgbrNMv2mhU6lQA=; b=cmijwa4dSAK+VpMMZCR1JZc4j2dl5cqm9Cr0Xro/6lCWIP8xckEok5wGbZCLrGRgl9+6z9+3dvcCf3wBw4xyg2nq4Q70wGgnSkAWnp2gd4D44saf6uhXvy6fVyKgvL57GjO0WQlxjsiA0ZJGUVT4+72XWYw/yIox70UWBBwPhjmMWbmvNTEeuYguXvU9siGzqyvT/9PWmC0E4Lkj2HVBtV9PGFP1qQQM3acrYWRTUeIcpxw9qVGxnEPEW/fvouRZT/1vFAz2AG4snZTcV0c2mtTilt7GEP8bwH2li5Hc/09hUH6aNVtRZbpIlYORIzkrzkivpgBedwY95DAsolxiRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=WPhFq69eXbgglHblkGsyHzButn+qvgbrNMv2mhU6lQA=; b=k9MWJMh7cOzyZds2+wuHiB15UJs/tuwrMXi7fQvWRflSxZKkUBt4kKnNGhWKn6jdhybyMoZu6zM08U+IZgHwu+wCP+J4R1pGK31HtcnWOLUs/90uYk5ykzRQJkG5kBWUos3lcrtUW7EvkciFI9LSxw8od2gZccEHrzL+eS8pAUMQvZnkKSZseE4qRmkPweFwhjXddkuNOonGRA0CtslDYP/7I1NuhVSFSrr3DBimiQeUYSnhIpPgnP68QAc3v8btx2GuhN7Smmog4HPgSr0R8oeW8RzOyBkC8cetnL6pTYVXBzuWIQ//K0nfCbrSwlMN/qrGVd+Hs9cxvfb6RL/Ktg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by BY5PR12MB3779.namprd12.prod.outlook.com (2603:10b6:a03:1a7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Thu, 7 Apr 2022 07:07:42 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::4c9:9b43:f068:7ee2]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::4c9:9b43:f068:7ee2%2]) with mapi id 15.20.5144.022; Thu, 7 Apr 2022 07:07:42 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, petrm@nvidia.com, vadimp@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net] mlxsw: i2c: Fix initialization error flow Date: Thu, 7 Apr 2022 10:07:03 +0300 Message-Id: <20220407070703.2421076-1-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 X-ClientProxiedBy: VI1PR0102CA0030.eurprd01.prod.exchangelabs.com (2603:10a6:802::43) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c372aa27-d3d5-4de5-f9ac-08da18654ebc X-MS-TrafficTypeDiagnostic: BY5PR12MB3779:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kXGt/gPVCqrj8z2mYgqN8mKA+oHUkz8zB6igDwZ0Wug79yxOmN8BVp6ld+elQF8kxOAFbpA22jtEvUr3JGl0X8kT31NIOwvjAv+Yx/bGv7AWaOWnCuyFtPf3QYwE5b16H9mcoXTiYeddA3fjQH7rKuaQwGSJHSABhV+fdR/d5tscErgVffgKD9QfhoZFbJCmXzB8AfkfWyayx4NFb6lbnz40IjzO3bHRSlKqep6xJurU5JtA1TCGJi5xRzZn/lRz7s7vvV54BheMp2fQJtXfMJUh95skJEwzI0U7mQa0PmdELGwtVKj5i/WC4a71r+BCbEaylYlr3geQ6NrD+B3g2TJYwwO5ElDfcWrLC6ZlePjEp5MZLAcrfXyX9Qnc+v6zqSUq53SONWKul6nDchqZG9PGnzmpPJMARQlhz3ycqdcQT9eJckE8wel/wGA3voJRn/YdNbdJYVQ58QwbnloFVlqGr02ZZ1qAaTXm7OC2gPViRG7ppPyIbS67k13AB4DM/oAdiwT+Is2xYu8+HLRHJC5KyK4QeS6azrU9cdz/HcY1J4mqlo4W0nsjYAS2cu8PLA2qkLQSLLMp1T9zga2Y1R/5C1mpfaaG4+6AAwH0qL6yjLDuiQ9RsxBctmLz5zZjpz2a1x/wqakl6x4cHT6NDg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(1076003)(26005)(66556008)(186003)(6916009)(66476007)(316002)(4326008)(36756003)(8676002)(83380400001)(66946007)(6666004)(4744005)(6512007)(5660300002)(107886003)(2616005)(6486002)(508600001)(38100700002)(2906002)(8936002)(86362001)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DvrjOZ/8eiE8xJsomCuVcJ5PJCc7y0OJ4MEKOTsUiMhOAjvpfH3P0oCkMwWyttzSYU9oGC32PBYWLWB2KYkZqCSdFFQcYCZpbHR+VcuHfJSXj1aubyBpR7G9rRRoMjGA2HxPKBS2SiBmbW8vvEXfgESlxEfgYfYefT0MZ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i/P+8EF2JP75QcjR5x2cPHMtdRX4DCqL4zoLHmQX0nin2qtEW6dlR9cguQ6513nVq2Bv/nyciing1T23lw53vLisr5Pm56dISJptHoYhgkkW+R/jWjI/gLPrvEDuhlWTSO8nxc0GPTU/KqF2eK71UudRW3TS3pT697Rlir/h0tyJCtJ3q4I6a/71sm5ooTwVIvGmTyPwl0hwcEA3F2BKGZKui5jCpeSGdA7o0HkbOgq46fe0AcjRLM254T+iRx8CwboJR9HWeVTpcEpXLuURLCiEld8duy4NT5tx44RfIgfrilCd6WE9ZsqWaZ1bFy86zzS9EpPh7PLWA2OCbKGqN7nrYkzq+IXbNTbRUetzeydvULNX52n+dMeV3vMA0gZrhnCwCzoQoSWxV68Dp25z2zIi+5FmDU8FC8avVWt7l1HhFIwzaoB+90K+hzSJLesLYNnpLlUB3CbP3WCwDp7rtjGDyQXCqcOpKcgUKx83+pDR0RxA9BhfJw== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c372aa27-d3d5-4de5-f9ac-08da18654ebc X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2022 07:07:41.9679 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mrrNmWhLlXlbg549eWHzPXKJnjz2AX9OUdtfKkld6iFQMxAxBwpueg36ClzndCUSdJkbATnuqsp67fNncHhmLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3779 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vadim Pasternak Add mutex_destroy() call in driver initialization error flow. Fixes: 6882b0aee180f ("mlxsw: Introduce support for I2C bus") Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/i2c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c index 939b692ffc33..ce843ea91464 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c +++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c @@ -650,6 +650,7 @@ static int mlxsw_i2c_probe(struct i2c_client *client, return 0; errout: + mutex_destroy(&mlxsw_i2c->cmd.lock); i2c_set_clientdata(client, NULL); return err;