lkml.org 
[lkml]   [2003]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subjectinput layer
Something that you might want to try in -mm, but which
is not for Linus' tree is the below.

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.

Andries


diff -u --recursive --new-file -X /linux/dontdiff a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c Mon Jun 23 04:43:32 2003
+++ b/drivers/input/keyboard/atkbd.c Sat Aug 9 22:59:21 2003
@@ -473,6 +473,7 @@
struct atkbd *atkbd = serio->private;
input_unregister_device(&atkbd->dev);
serio_close(serio);
+ serio->private = NULL;
kfree(atkbd);
}

@@ -518,6 +519,7 @@
serio->private = atkbd;

if (serio_open(serio, dev)) {
+ serio->private = NULL;
kfree(atkbd);
return;
}
@@ -526,6 +528,7 @@

if (atkbd_probe(atkbd)) {
serio_close(serio);
+ serio->private = NULL;
kfree(atkbd);
return;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:47    [W:1.339 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site