wifi: Set interface to NULL in interface_removed
authorYu A Wang <arron.wang@intel.com>
Wed, 21 Dec 2011 07:14:58 +0000 (02:14 -0500)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 5 Jan 2012 09:50:45 +0000 (10:50 +0100)
commitae574c8863e8c908791697c927b69c9bc0bbdadf
treec03b42c28539297e1a2942ba45db5c12980cfad2
parent3f3a5b5d99080f32112c8bcec32ad4f8421d6459
wifi: Set interface to NULL in interface_removed

Currently we set wifi interface to NULL in interface_remove_callback.
commit 80e2e08b4887c4e133d3ca7d42ac844fbb974bb8 avoid to use stale
pointer by get wifi pointer through interface, but interface already
removed and should be NULL, then the interface value in wifi will never
set to NULL and will be a wild pointer. Which may cause connman crash
when we connect wifi service after we disable the wifi. This issue does
not exist in latest connman due to connect-service method is removed.

we can set wifi interface in interface_removed which called in remove_interface
in supplicant.c, because after interface is freed in supplicant, we should not
hold this pointer anymore.

Fixes BMC#24364
plugins/wifi.c