wireless: remove freed wireless devices from the vlist avl tree
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Dec 2013 18:19:11 +0000 (19:19 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 11 Dec 2013 18:21:54 +0000 (19:21 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
wireless.c

index 1f7fc5d6c56d3bc3d1654147d435f8e34f5a1064..34603372903b14ea12c88236ce111587ccdac2fc 100644 (file)
@@ -270,9 +270,10 @@ __wireless_device_set_up(struct wireless_device *wdev)
 static void
 wireless_device_free(struct wireless_device *wdev)
 {
-    vlist_flush_all(&wdev->interfaces);
-    free(wdev->config);
-    free(wdev);
+       vlist_flush_all(&wdev->interfaces);
+       avl_delete(&wireless_devices.avl, &wdev->node.avl);
+       free(wdev->config);
+       free(wdev);
 }
 
 static void