diff options
-rw-r--r-- | utils.c | 16 | ||||
-rw-r--r-- | utils.h | 2 |
2 files changed, 18 insertions, 0 deletions
@@ -656,6 +656,22 @@ fw3_free_object(void *obj, const void *opts) free(obj); } +void +fw3_free_list(struct list_head *head) +{ + struct list_head *entry, *tmp; + + if (!head) + return; + + list_for_each_safe(entry, tmp, head) + { + list_del(entry); + free(entry); + } + + free(head); +} bool fw3_hotplug(bool add, void *zone, void *device) @@ -91,6 +91,8 @@ void fw3_write_statefile(void *state); void fw3_free_object(void *obj, const void *opts); +void fw3_free_list(struct list_head *head); + bool fw3_hotplug(bool add, void *zone, void *device); #endif |