From: "weiyongjun \(A\)" <weiyongjun1@huawei.com>
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: [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()
Date: Mon, 29 Apr 2019 12:26:30 +0000 [thread overview]
Message-ID: <20190429122630.59334-1-weiyongjun1@huawei.com> (raw)
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;
}
WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com>
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()
Date: Mon, 29 Apr 2019 12:26:30 +0000 [thread overview]
Message-ID: <20190429122630.59334-1-weiyongjun1@huawei.com> (raw)
Message-ID: <20190429122630.CkaY0LCCLXzD6dl7_ET-_mo6Qr4ktZTwpCgjVH7eL6w@z> (raw)
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;
}
next reply other threads:[~2019-04-29 12:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-29 12:26 weiyongjun (A) [this message]
2019-04-29 12:19 ` [-next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row() 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
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=20190429122630.59334-1-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei.com \
--cc=ajayg@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox