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

hwsim: check pending_create_msg before replying

In the NEW_RADIO callback hwsim was assuming that DBus had no
yet replied to the Create() method. In some cases the NEW_RADIO
event fires before the actual callback which will respond to
DBus. This causes a crash in the create callback.
This commit is contained in:
James Prestwood 2020-12-17 11:36:02 -08:00 committed by Denis Kenzior
parent 554a78fbf0
commit 799ab03f59

View File

@ -1579,7 +1579,7 @@ static void radio_manager_create_callback(struct l_genl_msg *msg,
*/ */
radio = l_queue_find(radio_info, radio_info_match_id, radio = l_queue_find(radio_info, radio_info_match_id,
L_UINT_TO_PTR(pending_create_radio_id)); L_UINT_TO_PTR(pending_create_radio_id));
if (radio) { if (radio && pending_create_msg) {
const char *path = radio_get_path(radio); const char *path = radio_get_path(radio);
reply = l_dbus_message_new_method_return(pending_create_msg); reply = l_dbus_message_new_method_return(pending_create_msg);