diff options
author | Qiushi Wu <wu000273@umn.edu> | 2020-05-22 22:16:08 -0500 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2020-06-30 11:41:25 +0200 |
commit | aaa3cbbac326c95308e315f1ab964a3369c4d07d (patch) | |
tree | c266c503d57c6c226a938eeb9beb2fdb30cc12d3 /drivers/platform | |
parent | 9a876ba58d1e660e7957dd7afd1129b615eb1e04 (diff) | |
download | linux-stable-aaa3cbbac326c95308e315f1ab964a3369c4d07d.tar.gz linux-stable-aaa3cbbac326c95308e315f1ab964a3369c4d07d.tar.bz2 linux-stable-aaa3cbbac326c95308e315f1ab964a3369c4d07d.zip |
platform/chrome: cros_ec_ishtp: Fix a double-unlock issue
In function cros_ec_ishtp_probe(), "up_write" is already called
before function "cros_ec_dev_init". But "up_write" will be called
again after the calling of the function "cros_ec_dev_init" failed.
Thus add a call of the function “down_write” in this if branch
for the completion of the exception handling.
Fixes: 26a14267aff2 ("platform/chrome: Add ChromeOS EC ISHTP driver")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Tested-by: Mathew King <mathewk@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/chrome/cros_ec_ishtp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c index ed794a7ddba9..81364029af36 100644 --- a/drivers/platform/chrome/cros_ec_ishtp.c +++ b/drivers/platform/chrome/cros_ec_ishtp.c @@ -681,8 +681,10 @@ static int cros_ec_ishtp_probe(struct ishtp_cl_device *cl_device) /* Register croc_ec_dev mfd */ rv = cros_ec_dev_init(client_data); - if (rv) + if (rv) { + down_write(&init_lock); goto end_cros_ec_dev_init_error; + } return 0; |