summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorLeena Gunda <leena.gunda@wipro.com>2011-01-06 11:19:51 +0530
committerMarcel Holtmann <marcel@holtmann.org>2011-01-05 22:04:39 -0800
commitb35c5c84316d50a04c23ae09885390a71ff58f8d (patch)
treec2aa47a129d8da809370341ef0f7a9c52c8722dc /gsupplicant
parent809fcb417e4b3781b31ddf22fe548f14d15fbb36 (diff)
downloadconnman-b35c5c84316d50a04c23ae09885390a71ff58f8d.tar.gz
connman-b35c5c84316d50a04c23ae09885390a71ff58f8d.tar.bz2
connman-b35c5c84316d50a04c23ae09885390a71ff58f8d.zip
Fix Valgrind invalid write error for WiFi plugin
g_supplicant_unregister first destroys the interface table and then invokes system_killed callback which will trigger wifi device driver removal. wifi_remove will now set it's interface data to NULL but the GSupplicantInterface has already been freed and hence the issue. Invoking the system_killed callback before destroying the interface table in gsupplicant will fix this issue. Fixes BMC#11684
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/supplicant.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 84526569..6302af01 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2633,6 +2633,9 @@ void g_supplicant_unregister(const GSupplicantCallbacks *callbacks)
bss_mapping = NULL;
}
+ if (system_available == TRUE)
+ callback_system_killed();
+
if (interface_table != NULL) {
g_hash_table_foreach(interface_table,
unregister_remove_interface, NULL);
@@ -2640,9 +2643,6 @@ void g_supplicant_unregister(const GSupplicantCallbacks *callbacks)
interface_table = NULL;
}
- if (system_available == TRUE)
- callback_system_killed();
-
if (connection != NULL) {
dbus_connection_unref(connection);
connection = NULL;