All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Cheng <vincent.cheng.xh@renesas.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
Date: Wed, 6 Nov 2019 14:02:43 +0000	[thread overview]
Message-ID: <20191106140228.GA28081@renesas.com> (raw)
In-Reply-To: <20191106115308.112645-1-weiyongjun1@huawei.com>

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>

WARNING: multiple messages have this Message-ID (diff)
From: Vincent Cheng <vincent.cheng.xh@renesas.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] ptp: Fix missing unlock on error in idtcm_probe()
Date: Wed, 06 Nov 2019 14:02:43 +0000	[thread overview]
Message-ID: <20191106140228.GA28081@renesas.com> (raw)
In-Reply-To: <20191106115308.112645-1-weiyongjun1@huawei.com>

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

  reply	other threads:[~2019-11-06 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191106140228.GA28081@renesas.com \
    --to=vincent.cheng.xh@renesas.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.