dock: fix dereference after kfree()
authorDan Carpenter <error27@gmail.com>
Thu, 2 Apr 2009 05:29:56 +0000 (08:29 +0300)
committerLen Brown <len.brown@intel.com>
Fri, 3 Apr 2009 16:48:59 +0000 (12:48 -0400)
commitf240729832dff3785104d950dad2d3ced4387f6d
tree8dff01796a28e04641691e110b481fbef592bde1
parent5b4c0b6fffb91b07a6f85dabbdfbd5abab61d9db
dock: fix dereference after kfree()

dock_remove() calls kfree() on dock_station so we should use
list_for_each_entry_safe() to avoid dereferencing freed memory.

Found by smatch (http://repo.or.cz/w/smatch.git/).  Compile tested.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/dock.c