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>] [day] [month] [year] [list]
Message-Id: <20210318034448.616-1-tangchunyou@163.com>
Date:   Thu, 18 Mar 2021 11:44:48 +0800
From:   ChunyouTang <tangchunyou@....com>
To:     dmitry.torokhov@...il.com, wangxiongfeng2@...wei.com
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        tangchunyou@...ong.com
Subject: [PATCH] drivers/input/mouse:modify mutex_lock before mutex_unlock

From: tangchunyou <tangchunyou@...ong.com>

mutex_lock should before mutex_unlock

Signed-off-by: tangchunyou <tangchunyou@...ong.com>
---
 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ