mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[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]>
This commit is contained in:
parent
c0438174e8
commit
22d0def9d0
1 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
||||
gameport_unregister_port(ns558->gameport);
|
||||
release_region(ns558->io & ~(ns558->size - 1), ns558->size);
|
||||
kfree(ns558);
|
||||
|
|
|
|||
Loading…
Reference in a new issue