Skip to content

Commit

Permalink
platform/chrome: cros_ec_ishtp: Fix a double-unlock issue
Browse files Browse the repository at this point in the history
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: 26a1426 ("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>
  • Loading branch information
Qiushi Wu authored and Enric Balletbo i Serra committed Jun 30, 2020
1 parent 9a876ba commit aaa3cbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/platform/chrome/cros_ec_ishtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit aaa3cbb

Please sign in to comment.