Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3063733pxb; Mon, 18 Apr 2022 14:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYFozfwau9d08B00r/yMvFnGTTE/PL7k4Ao1tKftdmuKmEHsetuVNY5aKy/OPhv/EazuAZ X-Received: by 2002:a17:902:744a:b0:158:9b85:192e with SMTP id e10-20020a170902744a00b001589b85192emr12830117plt.96.1650318989777; Mon, 18 Apr 2022 14:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650318989; cv=none; d=google.com; s=arc-20160816; b=g1Suf8njS35PECnpQtOKuAqYE2w/ox5r1vpUOKgBF1AYTZjK0HNTtsBhexkdKxwJQI NlY7/vvAKY/cRGGLm+nAURkoT+TkTSVWDMwwmVdqen4CGtDwTKpNtgJ1NisJK1I5Uvzf dq68kX+lwjXT9DI9yk+72SJxKZjOQZMzxYJJqIf/JwN6zNLbmL1IITkANgvmoBDSPtAD NiUrY3t3yEK9ruDB2CO1qiqYNjLhWdObY921ifqNtrV1WpijL660IZ9bOJ0uhjsSVmW+ MLAPsqx7ISBghPk7T+5bLT11Vrh/RTPYWNNupDzQjhYHmiF6gEJNAbfCbaXR/7m2bkDp /Fxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zVfGqykpvWWDAnMQUizyD6c2HgO8I6U4z2fburggn/c=; b=PTZiGPP2hR7Ahos2JOKPeURYlgaJVoIbyWP555yn6n8dA9BqtNXQFFGosnsuoRvcgy SrLpyT8TM5YzSAvvNNQN4fa50kjuwB+8fmF/2+lQ5pDejog9Hp+pwpSj/a7q6lvJ+5/s miP8A6+Tsq/eka1zY/QWMztVZsyeZuXeN5rRnt7ihpMK4vrD+VuEkcu4CaV5ciN1fqlH BsFf0UJgON4MT2LqHI9AiNE1ZyWkrEp2GzCRERrSxdnEBGDDiHYeqd5/P/NlJnEKacA5 eP7Kg72jAqDOkLOKm2UVru2yHQdM6uMN65zU/qtx1MMPTRmPser+kYvpwOq7mfP+hHjC CsNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OvOFsDUE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a170902cf0300b00153b2d16424si10581558plg.44.2022.04.18.14.56.11; Mon, 18 Apr 2022 14:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OvOFsDUE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343518AbiDROEI (ORCPT + 99 others); Mon, 18 Apr 2022 10:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243464AbiDRNqn (ORCPT ); Mon, 18 Apr 2022 09:46:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3342C27143; Mon, 18 Apr 2022 06:00:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C28B060B3A; Mon, 18 Apr 2022 13:00:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACC58C385A1; Mon, 18 Apr 2022 13:00:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286844; bh=G3r+WlNIzMT9anVEDUcHlMm/sERjt+PIsSqzrRHCOTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OvOFsDUE50FjKk2GvNHpO1NTEq1QhLFBgt94dnOlqMeNvbLWZk+pqYrlrHXO8FX06 9AJQV/yh/Zrj6bo//HsOCAZ23X11u44QzVuXahhBxsem+7RjuxTAfLf5rlsweU3fPH PiCnhl5m9JEUH+mHmOluVU2X2PyWmX9zXAQj/HaM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vadim Pasternak , Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.14 264/284] mlxsw: i2c: Fix initialization error flow Date: Mon, 18 Apr 2022 14:14:05 +0200 Message-Id: <20220418121220.174376447@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vadim Pasternak [ Upstream commit d452088cdfd5a4ad9d96d847d2273fe958d6339b ] 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 Link: https://lore.kernel.org/r/20220407070703.2421076-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 c0dcfa05b077..3d10e6100748 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c +++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c @@ -548,6 +548,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; -- 2.35.1