aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-06-29 01:06:35 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-06-29 01:06:35 -0400
commit33143ea1a34d12699e6aa222ba124498abcfe4d1 (patch)
tree5f104ff42e9c964bebd508e9354d5a6468628edd /drivers
parent9f7a60d6e47a70957e5f6676cfe8c83956b08aa6 (diff)
Input: serio - take drv_mutex in serio_cleanup()
We need to take serio->drv_mutex in serio_cleanup() to prevent the function from being called while driver is in the middle of attaching to a serio port. Such situation can happen with i8042 and atkbd drivers if user rapidly presses Ctrl-Alt-Del during system startup, and leads to kernel oops. Reported-by: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/serio/serio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 5895202b972c..a8f3bc1dff22 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -769,8 +769,10 @@ static int serio_driver_remove(struct device *dev)
769 769
770static void serio_cleanup(struct serio *serio) 770static void serio_cleanup(struct serio *serio)
771{ 771{
772 mutex_lock(&serio->drv_mutex);
772 if (serio->drv && serio->drv->cleanup) 773 if (serio->drv && serio->drv->cleanup)
773 serio->drv->cleanup(serio); 774 serio->drv->cleanup(serio);
775 mutex_unlock(&serio->drv_mutex);
774} 776}
775 777
776static void serio_shutdown(struct device *dev) 778static void serio_shutdown(struct device *dev)