* [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
@ 2019-04-29 12:26 weiyongjun (A)
2019-04-29 12:19 ` Heikki Krogerus
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: weiyongjun (A) @ 2019-04-29 12:26 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman, Ajay Gupta, Wolfram Sang
Cc: Wei Yongjun, linux-usb, kernel-janitors
Add the missing unlock before return from function ccg_cmd_write_flash_row()
in the error handling case.
Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 4632b91a04a6..9d46aa9e4e35 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
if (ret != CCG4_ROW_SIZE + 2) {
dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
+ mutex_unlock(&uc->lock);
return ret < 0 ? ret : -EIO;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
@ 2019-04-29 12:19 ` Heikki Krogerus
2019-04-29 12:19 ` [PATCH -next] " Heikki Krogerus
0 siblings, 1 reply; 6+ messages in thread
From: Heikki Krogerus @ 2019-04-29 12:19 UTC (permalink / raw)
To: Wei Yongjun
Cc: Greg Kroah-Hartman, Ajay Gupta, Wolfram Sang, linux-usb,
kernel-janitors
On Mon, Apr 29, 2019 at 12:26:30PM +0000, Wei Yongjun wrote:
> Add the missing unlock before return from function ccg_cmd_write_flash_row()
> in the error handling case.
>
> Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 4632b91a04a6..9d46aa9e4e35 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
> ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
> if (ret != CCG4_ROW_SIZE + 2) {
> dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
> + mutex_unlock(&uc->lock);
> return ret < 0 ? ret : -EIO;
> }
>
>
thanks,
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
2019-04-29 12:19 ` Heikki Krogerus
@ 2019-04-29 12:19 ` Heikki Krogerus
0 siblings, 0 replies; 6+ messages in thread
From: Heikki Krogerus @ 2019-04-29 12:19 UTC (permalink / raw)
To: Wei Yongjun
Cc: Greg Kroah-Hartman, Ajay Gupta, Wolfram Sang, linux-usb,
kernel-janitors
On Mon, Apr 29, 2019 at 12:26:30PM +0000, Wei Yongjun wrote:
> Add the missing unlock before return from function ccg_cmd_write_flash_row()
> in the error handling case.
>
> Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 4632b91a04a6..9d46aa9e4e35 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
> ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
> if (ret != CCG4_ROW_SIZE + 2) {
> dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
> + mutex_unlock(&uc->lock);
> return ret < 0 ? ret : -EIO;
> }
>
>
thanks,
--
heikki
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
2019-04-29 12:26 [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row() weiyongjun (A)
2019-04-29 12:19 ` Heikki Krogerus
@ 2019-04-29 12:26 ` Wei Yongjun
2019-04-29 16:52 ` [-next] " Ajay Gupta
2 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-04-29 12:26 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman, Ajay Gupta, Wolfram Sang
Cc: Wei Yongjun, linux-usb, kernel-janitors
Add the missing unlock before return from function ccg_cmd_write_flash_row()
in the error handling case.
Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
index 4632b91a04a6..9d46aa9e4e35 100644
--- a/drivers/usb/typec/ucsi/ucsi_ccg.c
+++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
@@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
if (ret != CCG4_ROW_SIZE + 2) {
dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
+ mutex_unlock(&uc->lock);
return ret < 0 ? ret : -EIO;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
@ 2019-04-29 16:52 ` Ajay Gupta
2019-04-29 16:52 ` [PATCH -next] " Ajay Gupta
0 siblings, 1 reply; 6+ messages in thread
From: Ajay Gupta @ 2019-04-29 16:52 UTC (permalink / raw)
To: Wei Yongjun, Heikki Krogerus, Greg Kroah-Hartman, Wolfram Sang
Cc: linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Hi Wei
> -----Original Message-----
> From: Wei Yongjun <weiyongjun1@huawei.com>
> Sent: Monday, April 29, 2019 5:27 AM
> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Ajay Gupta <ajayg@nvidia.com>; Wolfram Sang
> <wsa@the-dreams.de>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-usb@vger.kernel.org;
> kernel-janitors@vger.kernel.org
> Subject: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in
> ccg_cmd_write_flash_row()
>
> Add the missing unlock before return from function ccg_cmd_write_flash_row()
> in the error handling case.
Thanks for fixing this. The change looks good.
> nvpublic
>
> Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c
> b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 4632b91a04a6..9d46aa9e4e35 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
> ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
> if (ret != CCG4_ROW_SIZE + 2) {
> dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
> + mutex_unlock(&uc->lock);
> return ret < 0 ? ret : -EIO;
> }
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
2019-04-29 16:52 ` [-next] " Ajay Gupta
@ 2019-04-29 16:52 ` Ajay Gupta
0 siblings, 0 replies; 6+ messages in thread
From: Ajay Gupta @ 2019-04-29 16:52 UTC (permalink / raw)
To: Wei Yongjun, Heikki Krogerus, Greg Kroah-Hartman, Wolfram Sang
Cc: linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Hi Wei
> -----Original Message-----
> From: Wei Yongjun <weiyongjun1@huawei.com>
> Sent: Monday, April 29, 2019 5:27 AM
> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Ajay Gupta <ajayg@nvidia.com>; Wolfram Sang
> <wsa@the-dreams.de>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-usb@vger.kernel.org;
> kernel-janitors@vger.kernel.org
> Subject: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in
> ccg_cmd_write_flash_row()
>
> Add the missing unlock before return from function ccg_cmd_write_flash_row()
> in the error handling case.
Thanks for fixing this. The change looks good.
> nvpublic
>
> Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/usb/typec/ucsi/ucsi_ccg.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c
> b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 4632b91a04a6..9d46aa9e4e35 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -631,6 +631,7 @@ ccg_cmd_write_flash_row(struct ucsi_ccg *uc, u16 row,
> ret = i2c_master_send(client, buf, CCG4_ROW_SIZE + 2);
> if (ret != CCG4_ROW_SIZE + 2) {
> dev_err(uc->dev, "REG_FLASH_RW_MEM write fail %d\n", ret);
> + mutex_unlock(&uc->lock);
> return ret < 0 ? ret : -EIO;
> }
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-29 16:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-29 12:26 [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row() weiyongjun (A)
2019-04-29 12:19 ` Heikki Krogerus
2019-04-29 12:19 ` [PATCH -next] " Heikki Krogerus
2019-04-29 12:26 ` Wei Yongjun
2019-04-29 16:52 ` [-next] " Ajay Gupta
2019-04-29 16:52 ` [PATCH -next] " Ajay Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox