summaryrefslogtreecommitdiffstats
path: root/drivers/ptp
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-11-06 15:33:09 +0100
committerDavid S. Miller <davem@davemloft.net>2019-11-07 06:19:59 +0100
commitb97fa0b54447107e572ac7ba6ad0f0fd64170104 (patch)
treeb7d570412f8d0f54e6aed08b3618885b17d5046f /drivers/ptp
parenttipc: eliminate the dummy packet in link synching (diff)
downloadlinux-b97fa0b54447107e572ac7ba6ad0f0fd64170104.tar.xz
linux-b97fa0b54447107e572ac7ba6ad0f0fd64170104.zip
ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
Add the missing unlock before return from function idtcm_probe() in the error handling case. Fixes: 3a6ba7dc7799 ("ptp: Add a ptp clock driver for IDT ClockMatrix.") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Vincent Cheng <vincent.cheng.xh@renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp')
-rw-r--r--drivers/ptp/ptp_clockmatrix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_clockmatrix.c b/drivers/ptp/ptp_clockmatrix.c
index cf5889b7d825..a5110b7b4ece 100644
--- a/drivers/ptp/ptp_clockmatrix.c
+++ b/drivers/ptp/ptp_clockmatrix.c
@@ -1294,8 +1294,10 @@ static int idtcm_probe(struct i2c_client *client,
err = set_tod_write_overhead(idtcm);
- if (err)
+ if (err) {
+ mutex_unlock(&idtcm->reg_lock);
return err;
+ }
err = idtcm_load_firmware(idtcm, &client->dev);