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 Tue Dec 16 13:36:19 2003 +++ 25-akpm/drivers/input/keyboard/atkbd.c Tue Dec 16 13:36:19 2003 @@ -585,6 +585,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); } @@ -644,6 +645,7 @@ static void atkbd_connect(struct serio * serio->private = atkbd; if (serio_open(serio, dev)) { + serio->private = NULL; kfree(atkbd); return; } @@ -652,6 +654,7 @@ static void atkbd_connect(struct serio * if (atkbd_probe(atkbd)) { serio_close(serio); + serio->private = NULL; kfree(atkbd); return; } _