netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
@ 2019-11-06 11:53 Wei Yongjun
  2019-11-06 14:02 ` Vincent Cheng
  2019-11-06 14:33 ` [PATCH v2 -next] ptp: ptp_clockmatrix: " Wei Yongjun
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2019-11-06 11:53 UTC (permalink / raw)
  To: Richard Cochran, Vincent Cheng; +Cc: Wei Yongjun, netdev, kernel-janitors

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>
---
 drivers/ptp/ptp_clockmatrix.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-07  5:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-06 11:53 [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe() Wei Yongjun
2019-11-06 14:02 ` Vincent Cheng
2019-11-06 14:25   ` Dan Carpenter
2019-11-06 14:33 ` [PATCH v2 -next] ptp: ptp_clockmatrix: " Wei Yongjun
2019-11-07  5:20   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).