tree b17c0fd6d98afc0af6920d18e096e7ab814189de
parent c0438174e8272d23fe43a5d3f23d777f5b412e87
author Alexander Nyberg <[EMAIL PROTECTED]> Thu, 11 Aug 2005 00:11:36 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 11 Aug 2005 01:03:02 -0700

[PATCH] ns558 list handling fix

Need to use list_for_entry_safe(), as we're removing items during the
traversal.  list_for_each_entry() uses the first ptr also as an iterator, if
you kfree() it slab takes it, might poison it and then you try to use it to
iterate to the next object in list.

Cc: Vojtech Pavlik <[EMAIL PROTECTED]>
Cc: Dmitry Torokhov <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/input/gameport/ns558.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
--- a/drivers/input/gameport/ns558.c
+++ b/drivers/input/gameport/ns558.c
@@ -275,9 +275,9 @@ static int __init ns558_init(void)
 static void __exit ns558_exit(void)
-       struct ns558 *ns558;
+       struct ns558 *ns558, *safe;
-       list_for_each_entry(ns558, &ns558_list, node) {
+       list_for_each_entry_safe(ns558, safe, &ns558_list, node) {
                release_region(ns558->io & ~(ns558->size - 1), ns558->size);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to