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
1 changed files with 1 additions and 1 deletions

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,
L_UINT_TO_PTR(pending_create_radio_id));
if (radio) {
if (radio && pending_create_msg) {
const char *path = radio_get_path(radio);
reply = l_dbus_message_new_method_return(pending_create_msg);