All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
@ 2019-11-06 11:53 ` Wei Yongjun
  0 siblings, 0 replies; 10+ 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] 10+ messages in thread

* [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
@ 2019-11-06 11:53 ` Wei Yongjun
  0 siblings, 0 replies; 10+ 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] 10+ messages in thread

* Re: [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
  -1 siblings, 0 replies; 10+ messages in thread
From: Vincent Cheng @ 2019-11-06 14:02 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Richard Cochran, netdev, kernel-janitors

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] 10+ messages in thread

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

T24gV2VkLCBOb3YgMDYsIDIwMTkgYXQgMDY6NTM6MDhBTSBFU1QsIFdlaSBZb25nanVuIHdyb3Rl
Og0KPkFkZCB0aGUgbWlzc2luZyB1bmxvY2sgYmVmb3JlIHJldHVybiBmcm9tIGZ1bmN0aW9uIGlk
dGNtX3Byb2JlKCkNCj5pbiB0aGUgZXJyb3IgaGFuZGxpbmcgY2FzZS4NCj4NCj5GaXhlczogM2E2
YmE3ZGM3Nzk5ICgicHRwOiBBZGQgYSBwdHAgY2xvY2sgZHJpdmVyIGZvciBJRFQgQ2xvY2tNYXRy
aXguIikNCj5TaWduZWQtb2ZmLWJ5OiBXZWkgWW9uZ2p1biA8d2VpeW9uZ2p1bjFAaHVhd2VpLmNv
bT4NCj4tLS0NCj4gZHJpdmVycy9wdHAvcHRwX2Nsb2NrbWF0cml4LmMgfCA0ICsrKy0NCj4gMSBm
aWxlIGNoYW5nZWQsIDMgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQ0KPg0KPmRpZmYgLS1n
aXQgYS9kcml2ZXJzL3B0cC9wdHBfY2xvY2ttYXRyaXguYyBiL2RyaXZlcnMvcHRwL3B0cF9jbG9j
a21hdHJpeC5jDQo+aW5kZXggY2Y1ODg5YjdkODI1Li5hNTExMGI3YjRlY2UgMTAwNjQ0DQo+LS0t
IGEvZHJpdmVycy9wdHAvcHRwX2Nsb2NrbWF0cml4LmMNCj4rKysgYi9kcml2ZXJzL3B0cC9wdHBf
Y2xvY2ttYXRyaXguYw0KPkBAIC0xMjk0LDggKzEyOTQsMTAgQEAgc3RhdGljIGludCBpZHRjbV9w
cm9iZShzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50LA0KPiANCj4gCWVyciA9IHNldF90b2Rfd3Jp
dGVfb3ZlcmhlYWQoaWR0Y20pOw0KPiANCj4tCWlmIChlcnIpDQo+KwlpZiAoZXJyKSB7DQo+KwkJ
bXV0ZXhfdW5sb2NrKCZpZHRjbS0+cmVnX2xvY2spOw0KPiAJCXJldHVybiBlcnI7DQo+Kwl9DQo+
IA0KPiAJZXJyID0gaWR0Y21fbG9hZF9maXJtd2FyZShpZHRjbSwgJmNsaWVudC0+ZGV2KTsNCj4N
Cg0KWWVzLCBnb29kIGNhdGNoLiAgVGhhbmsteW91IGZvciB0aGUgZml4Lg0KDQpSZXZpZXdlZC1i
eTogVmluY2VudCBDaGVuZyAgPHZpbmNlbnQuY2hlbmcueGhAcmVuZXNhcy5jb20+DQo

^ permalink raw reply	[flat|nested] 10+ 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
  -1 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2019-11-06 14:25 UTC (permalink / raw)
  To: Vincent Cheng; +Cc: Wei Yongjun, Richard Cochran, netdev, kernel-janitors

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] 10+ messages in thread

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

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] 10+ messages in thread

* [PATCH v2 -next] ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
  2019-11-06 11:53 ` Wei Yongjun
@ 2019-11-06 14:33   ` Wei Yongjun
  -1 siblings, 0 replies; 10+ 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] 10+ messages in thread

* [PATCH v2 -next] ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
@ 2019-11-06 14:33   ` Wei Yongjun
  0 siblings, 0 replies; 10+ 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] 10+ messages in thread

* Re: [PATCH v2 -next] ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
  2019-11-06 14:33   ` Wei Yongjun
@ 2019-11-07  5:20     ` David Miller
  -1 siblings, 0 replies; 10+ 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] 10+ messages in thread

* Re: [PATCH v2 -next] ptp: ptp_clockmatrix: Fix missing unlock on error in idtcm_probe()
@ 2019-11-07  5:20     ` David Miller
  0 siblings, 0 replies; 10+ 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] 10+ messages in thread

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

Thread overview: 10+ 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 11:53 ` Wei Yongjun
2019-11-06 14:02 ` Vincent Cheng
2019-11-06 14:02   ` Vincent Cheng
2019-11-06 14:25   ` Dan Carpenter
2019-11-06 14:25     ` Dan Carpenter
2019-11-06 14:33 ` [PATCH v2 -next] ptp: ptp_clockmatrix: " Wei Yongjun
2019-11-06 14:33   ` Wei Yongjun
2019-11-07  5:20   ` David Miller
2019-11-07  5:20     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.