linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atkbd: cleanup only once
@ 2007-06-27 10:59 Dave Young
  2007-06-27  3:01 ` dave young
  2007-06-27  4:34 ` Dmitry Torokhov
  0 siblings, 2 replies; 10+ messages in thread
From: Dave Young @ 2007-06-27 10:59 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-kernel

Hi,

If you press ctrl+alt+del several times as kernel booting (before user level bootin), the kernel will oops. I found the ps2_command is called more than once, then the ps2dev->serio maybe NULL pointer.

2.6.22-rc5 and 2.6.22-rc6 have same result.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
diff -upr linux/drivers/input/keyboard/atkbd.c linux.new/drivers/input/keyboard/atkbd.c
--- linux/drivers/input/keyboard/atkbd.c	2007-06-27 10:38:37.000000000 +0000
+++ linux.new/drivers/input/keyboard/atkbd.c	2007-06-27 10:37:39.000000000 +0000
@@ -795,6 +795,11 @@ static int atkbd_activate(struct atkbd *
 
 static void atkbd_cleanup(struct serio *serio)
 {
+	static int flag;
+
+	if(flag)
+		return;
+	flag = 1;
 	struct atkbd *atkbd = serio_get_drvdata(serio);
 	ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_BAT);
 }

Regards
dave

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-06-28  6:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-27 10:59 [PATCH] atkbd: cleanup only once Dave Young
2007-06-27  3:01 ` dave young
2007-06-27  4:34 ` Dmitry Torokhov
2007-06-27  4:28   ` Greg KH
2007-06-27  4:59     ` Dmitry Torokhov
2007-06-27  5:02       ` dave young
2007-06-28  5:18         ` Dmitry Torokhov
2007-06-28  6:12           ` dave young
2007-06-27  5:27       ` Greg KH
2007-06-27 13:37         ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).