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 2004-01-03 02:12:35.000000000 -0800 +++ 25-akpm/drivers/input/keyboard/atkbd.c 2004-01-03 02:12:35.000000000 -0800 @@ -591,6 +591,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); } @@ -650,6 +651,7 @@ static void atkbd_connect(struct serio * serio->private = atkbd; if (serio_open(serio, dev)) { + serio->private = NULL; kfree(atkbd); return; } @@ -658,6 +660,7 @@ static void atkbd_connect(struct serio * if (atkbd_probe(atkbd)) { serio_close(serio); + serio->private = NULL; kfree(atkbd); return; } _