From fb17920701dcba0d94e3fde566788a868e41d1ad Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 27 Aug 2005 16:15:41 +0200 Subject: add and use name_list_cleanup() for cleaning up the string lists Signed-off-by: Kay Sievers --- udevinfo.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'udevinfo.c') diff --git a/udevinfo.c b/udevinfo.c index b546488c7e..fadfaec945 100644 --- a/udevinfo.c +++ b/udevinfo.c @@ -170,19 +170,17 @@ exit: static void dump_names(void) { LIST_HEAD(name_list); struct name_entry *name_loop; - struct name_entry *tmp_loop; udev_db_get_all_entries(&name_list); - list_for_each_entry_safe(name_loop, tmp_loop, &name_list, node) { + list_for_each_entry(name_loop, &name_list, node) { struct udevice udev_db; udev_init_device(&udev_db, NULL, NULL, NULL); - if (udev_db_get_device(&udev_db, name_loop->name) == 0) { + if (udev_db_get_device(&udev_db, name_loop->name) == 0) printf("%s=%s/%s\n", udev_db.devpath, udev_root, udev_db.name); - free(name_loop); - } udev_cleanup_device(&udev_db); } + name_list_cleanup(&name_list); } int main(int argc, char *argv[], char *envp[]) -- cgit v1.2.3-54-g00ecf