3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 06:02:37 +01:00

netdev: Notify EVENT_DEL earlier

If we're going down, make sure to notify any watches about EVENT_DEL
earlier.  Not doing so might result in us not cleaning up requests that
might have been started as the result of this event.
This commit is contained in:
Denis Kenzior 2021-05-28 22:34:39 -05:00
parent cf950f6d3f
commit f6f5570bc8

View File

@ -802,6 +802,10 @@ static void netdev_free(void *data)
l_debug("Freeing netdev %s[%d]", netdev->name, netdev->index); l_debug("Freeing netdev %s[%d]", netdev->name, netdev->index);
if (netdev->events_ready)
WATCHLIST_NOTIFY(&netdev_watches, netdev_watch_func_t,
netdev, NETDEV_WATCH_EVENT_DEL);
if (netdev->neighbor_report_cb) { if (netdev->neighbor_report_cb) {
netdev->neighbor_report_cb(netdev, -ENODEV, NULL, 0, netdev->neighbor_report_cb(netdev, -ENODEV, NULL, 0,
netdev->user_data); netdev->user_data);
@ -870,10 +874,6 @@ static void netdev_free(void *data)
netdev->ft_ds_list = NULL; netdev->ft_ds_list = NULL;
} }
if (netdev->events_ready)
WATCHLIST_NOTIFY(&netdev_watches, netdev_watch_func_t,
netdev, NETDEV_WATCH_EVENT_DEL);
scan_wdev_remove(netdev->wdev_id); scan_wdev_remove(netdev->wdev_id);
watchlist_destroy(&netdev->station_watches); watchlist_destroy(&netdev->station_watches);