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. 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 2003-08-23 13:48:06.000000000 -0700 +++ 25-akpm/drivers/input/keyboard/atkbd.c 2003-08-23 13:48:06.000000000 -0700 @@ -473,6 +473,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); } @@ -518,6 +519,7 @@ static void atkbd_connect(struct serio * serio->private = atkbd; if (serio_open(serio, dev)) { + serio->private = NULL; kfree(atkbd); return; } @@ -526,6 +528,7 @@ static void atkbd_connect(struct serio * if (atkbd_probe(atkbd)) { serio_close(serio); + serio->private = NULL; kfree(atkbd); return; } _