lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1624277660-11440-1-git-send-email-kezhou.li@tinno.com>
Date:   Mon, 21 Jun 2021 20:14:20 +0800
From:   Kezhou Li <kezhou.li@...no.com>
To:     <pali@...nel.org>, <sre@...nel.org>
CC:     <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Kezhou Li <kezhou.li@...no.com>
Subject: [External][PATCH] power: supply: bq2415x: fix deadlock in
 bq2415x_set_autotimer

From: "Kezhou Li" <kezhou.li@...no.com>

The bq2415x_timer_error called by bq2415x_timer_work when some error
happens, and then calls cancel_delayed_work_sync(&bq->work). Finally
this function is waiting for the work to finish but the work is
waiting for the return of the function. So it causes a deadlock.

Signed-off-by: Kezhou Li <kezhou.li@...no.com>
---
 drivers/power/supply/bq2415x_charger.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c
index 5724001..7889edb 100644
--- a/drivers/power/supply/bq2415x_charger.c
+++ b/drivers/power/supply/bq2415x_charger.c
@@ -862,8 +862,6 @@ static void bq2415x_set_autotimer(struct bq2415x_device *bq, int state)
 		schedule_delayed_work(&bq->work, BQ2415X_TIMER_TIMEOUT * HZ);
 		bq2415x_exec_command(bq, BQ2415X_TIMER_RESET);
 		bq->timer_error = NULL;
-	} else {
-		cancel_delayed_work_sync(&bq->work);
 	}
 
 	mutex_unlock(&bq2415x_timer_mutex);
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ