From b6554ee41c79869b3b3abb86e8538c898c863ad6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 17 Oct 2019 13:03:08 -0500 Subject: [PATCH] hwsim: Invoke l_queue_remove prior to object deletion While the current code is quite safe, the new ordering makes more logical sense and doesn't confuse static analysis tools. --- tools/hwsim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/hwsim.c b/tools/hwsim.c index cade6a02..e9ba1f95 100644 --- a/tools/hwsim.c +++ b/tools/hwsim.c @@ -914,8 +914,8 @@ static void del_radio_event(struct l_genl_msg *msg) l_queue_foreach_remove(interface_info, interface_info_destroy_by_radio, radio); l_dbus_unregister_object(dbus, radio_get_path(radio)); - radio_free(radio); l_queue_remove(radio_info, radio); + radio_free(radio); } static void del_interface_event(struct l_genl_msg *msg) @@ -949,8 +949,8 @@ static void del_interface_event(struct l_genl_msg *msg) return; l_dbus_unregister_object(dbus, interface_get_path(interface)); - interface_free(interface); l_queue_remove(interface_info, interface); + interface_free(interface); } static void hwsim_config(struct l_genl_msg *msg, void *user_data)