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

* Re: [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Vincent Cheng @ 2019-11-06 14:02 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Richard Cochran, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org

On Wed, Nov 06, 2019 at 06:53:08AM EST, Wei Yongjun wrote:
>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);
>

Yes, good catch.  Thank-you for the fix.

Reviewed-by: Vincent Cheng  <vincent.cheng.xh@renesas.com>

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

* Re: [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
  2019-11-06 14:02 ` Vincent Cheng
@ 2019-11-06 14:25   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2019-11-06 14:25 UTC (permalink / raw)
  To: Vincent Cheng
  Cc: Wei Yongjun, Richard Cochran, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org

The prefix should probably be "ptp: ptp_clockmatrix: Fix missing ..." or
something.  This is a problem when we don't set a prefix when the driver
is first merged and then the first person to send a fix has to guess
what the maintainers are going to want to use.

The only other patch to this driver is commit 3a6ba7dc7799 ("ptp: Add a
ptp clock driver for IDT ClockMatrix.") so it's impossible to know.

regards,
dan carpenter


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

* [PATCH v2 -next] ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
  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:33 ` Wei Yongjun
  2019-11-07  5:20   ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Wei Yongjun @ 2019-11-06 14:33 UTC (permalink / raw)
  To: Richard Cochran, Vincent Cheng, Dan Carpenter
  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>
Reviewed-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
---
v1 -> v2: fix prefix of subject
---
 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

* Re: [PATCH v2 -next] ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
  2019-11-06 14:33 ` [PATCH v2 -next] ptp: ptp_clockmatrix: " Wei Yongjun
@ 2019-11-07  5:20   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-11-07  5:20 UTC (permalink / raw)
  To: weiyongjun1
  Cc: richardcochran, vincent.cheng.xh, dan.carpenter, netdev,
	kernel-janitors

From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 6 Nov 2019 14:33:09 +0000

> 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>
> ---
> v1 -> v2: fix prefix of subject

Applied, thanks.

^ permalink raw reply	[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).