mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 10:39:23 +01:00
manager: Don't try to create pending_state more than once
This commit is contained in:
parent
5cfc6e513d
commit
d85e6eedff
@ -406,15 +406,18 @@ static void manager_new_wiphy_event(struct l_genl_msg *msg)
|
|||||||
if (!wiphy_parse_id_and_name(&attr, &id, &name))
|
if (!wiphy_parse_id_and_name(&attr, &id, &name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A Wiphy split dump can generate many (6+) NEW_WIPHY messages
|
||||||
|
* We need to parse attributes from all of them, but only perform
|
||||||
|
* initialization steps once for each new wiphy detected
|
||||||
|
*/
|
||||||
wiphy = wiphy_find(id);
|
wiphy = wiphy_find(id);
|
||||||
if (!wiphy) {
|
if (wiphy)
|
||||||
wiphy = wiphy_create(id, name);
|
goto done;
|
||||||
|
|
||||||
if (!wiphy)
|
wiphy = wiphy_create(id, name);
|
||||||
return;
|
if (!wiphy)
|
||||||
}
|
return;
|
||||||
|
|
||||||
wiphy_update_from_genl(wiphy, msg);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We've got a new wiphy, flag it as new and wait for a
|
* We've got a new wiphy, flag it as new and wait for a
|
||||||
@ -433,6 +436,9 @@ static void manager_new_wiphy_event(struct l_genl_msg *msg)
|
|||||||
state->setup_timeout = l_timeout_create(1, manager_wiphy_setup_timeout,
|
state->setup_timeout = l_timeout_create(1, manager_wiphy_setup_timeout,
|
||||||
state, NULL);
|
state, NULL);
|
||||||
l_queue_push_tail(pending_wiphys, state);
|
l_queue_push_tail(pending_wiphys, state);
|
||||||
|
|
||||||
|
done:
|
||||||
|
wiphy_update_from_genl(wiphy, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool manager_wiphy_state_match(const void *a, const void *b)
|
static bool manager_wiphy_state_match(const void *a, const void *b)
|
||||||
|
Loading…
Reference in New Issue
Block a user