From: Andries.Brouwer@cwi.nl There are lots of places (not only the three below) where we leave a pointer to a structure, but free the structure itself. Bad habit. Making the pointer NULL will turn random behaviour into NULL deref when the pointer is ever touched. This does not fix anything. 25-akpm/drivers/input/keyboard/atkbd.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN drivers/input/keyboard/atkbd.c~input-use-after-free-checks drivers/input/keyboard/atkbd.c --- 25/drivers/input/keyboard/atkbd.c~input-use-after-free-checks Wed Sep 17 12:32:31 2003 +++ 25-akpm/drivers/input/keyboard/atkbd.c Wed Sep 17 12:32:31 2003 @@ -481,6 +481,7 @@ static void atkbd_disconnect(struct seri struct atkbd *atkbd = serio->private; input_unregister_device(&atkbd->dev); serio_close(serio); + serio->private = NULL; kfree(atkbd); } @@ -526,6 +527,7 @@ static void atkbd_connect(struct serio * serio->private = atkbd; if (serio_open(serio, dev)) { + serio->private = NULL; kfree(atkbd); return; } @@ -534,6 +536,7 @@ static void atkbd_connect(struct serio * if (atkbd_probe(atkbd)) { serio_close(serio); + serio->private = NULL; kfree(atkbd); return; } _