summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Pasternak <vadimp@nvidia.com>2022-04-07 10:07:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-20 09:08:31 +0200
commit5867c4e88fe1e1b23d57f749900ec5511bac6aa7 (patch)
treee50d90f033d4868d684f3d0990b5c36e62f44745
parent64f42625d8b6a6ac8651cc1520bafebb0ab9552d (diff)
mlxsw: i2c: Fix initialization error flow
[ 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 <vadimp@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/20220407070703.2421076-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/i2c.c1
1 files changed, 1 insertions, 0 deletions
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;