[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6e40a46e5d9e6e3237702958b8f641263c28d2e4.1765939397.git.duoming@zju.edu.cn>
Date: Wed, 17 Dec 2025 11:00:18 +0800
From: Duoming Zhou <duoming@....edu.cn>
To: linux-input@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
dmitry.torokhov@...il.com,
pali@...nel.org,
kuba@...nel.org,
alexander.deucher@....com,
akpm@...ux-foundation.org,
johannes.berg@...el.com,
pkshih@...ltek.com,
hverkuil+cisco@...nel.org,
andriy.shevchenko@...ux.intel.com,
tglx@...utronix.de,
mingo@...nel.org,
Duoming Zhou <duoming@....edu.cn>
Subject: [PATCH v2 RESEND 2/2] Input: psmouse - Replace flush_workqueue() with disable_delayed_work_sync()
The original code uses flush_workqueue() in psmouse_disconnect() to
ensure the completion of both resync_work and dev3_register_work.
Given that alps_disconnect() already uses disable_delayed_work_sync()
to cancel dev3_register_work, replacing flush_workqueue() with
disable_delayed_work_sync(&psmouse->resync_work) is more robust
and efficient.
Signed-off-by: Duoming Zhou <duoming@....edu.cn>
---
Changes in v2:
- focus on the robustness and efficiency improvements of disable_delayed_work_sync(), not on the UAF aspect.
drivers/input/mouse/psmouse-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 77ea7da3b1c..eb41c553e80 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1484,7 +1484,7 @@ static void psmouse_disconnect(struct serio *serio)
/* make sure we don't have a resync in progress */
mutex_unlock(&psmouse_mutex);
- flush_workqueue(kpsmoused_wq);
+ disable_delayed_work_sync(&psmouse->resync_work);
mutex_lock(&psmouse_mutex);
if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
--
2.34.1
Powered by blists - more mailing lists