Skip to content

Commit aaa3cbb

Browse files
QiushiWuEnric Balletbo i Serra
authored andcommitted
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: 26a1426 ("platform/chrome: Add ChromeOS EC ISHTP driver") Signed-off-by: Qiushi Wu <[email protected]> Tested-by: Mathew King <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
1 parent 9a876ba commit aaa3cbb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/platform/chrome/cros_ec_ishtp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,10 @@ static int cros_ec_ishtp_probe(struct ishtp_cl_device *cl_device)
681681

682682
/* Register croc_ec_dev mfd */
683683
rv = cros_ec_dev_init(client_data);
684-
if (rv)
684+
if (rv) {
685+
down_write(&init_lock);
685686
goto end_cros_ec_dev_init_error;
687+
}
686688

687689
return 0;
688690

0 commit comments

Comments
 (0)