Skip to contentSkip to conversation

Fix oops in parkbd

OOPS+PATCH 2.6 Dmitry Torokhov 1 participant 1 message Oct 10, 2004

lore
Share & tools
lore
#0 lore raw

When converting to dynamic serio allocation I messed up parkbd causing it to Oops when registering its serio port.

Signature · 32 lines
Dmitry


===================================================================


[email protected], 2004-10-09 08:09:54-05:00, [email protected]
  Input: parkbd - zero-fill allocated serio structure to
         prevent Oops when registering port.
  
  Signed-off-by: Dmitry Torokhov <[email protected]>


 parkbd.c |    1 +
 1 files changed, 1 insertion(+)


===================================================================



diff -Nru a/drivers/input/serio/parkbd.c b/drivers/input/serio/parkbd.c
--- a/drivers/input/serio/parkbd.c	2004-10-09 23:49:06 -05:00
+++ b/drivers/input/serio/parkbd.c	2004-10-09 23:49:06 -05:00
@@ -160,6 +160,7 @@
 
 	serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
 	if (serio) {
+		memset(serio, 0, sizeof(struct serio));
 		serio->type = parkbd_mode;
 		serio->write = parkbd_write,
 		strlcpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name));