DORMANTno replies

[PATCH] drivers/input/mouse:modify mutex_lock before mutex_unlock

From: ChunyouTang <hidden>
Date: 2021-03-18 08:03:07
Also in: lkml
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

From: tangchunyou <redacted>

mutex_lock should before mutex_unlock

Signed-off-by: tangchunyou <redacted>
---
 drivers/input/mouse/psmouse-base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 0b4a303..d01798c 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1923,9 +1923,9 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co
 			return -EIO;
 		}
 
-		mutex_unlock(&psmouse_mutex);
-		serio_unregister_child_port(serio);
 		mutex_lock(&psmouse_mutex);
+		serio_unregister_child_port(serio);
+		mutex_unlock(&psmouse_mutex);
 
 		if (serio->drv != &psmouse_drv) {
 			input_free_device(new_dev);
-- 
1.9.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help