summaryrefslogtreecommitdiff
path: root/udevinfo.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-27 16:15:41 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-27 16:15:41 +0200
commitfb17920701dcba0d94e3fde566788a868e41d1ad (patch)
tree7667c49dd48312ec58ab12d4da92cb9206bb6b69 /udevinfo.c
parent314edf3ca44b268fa70a7a87a106322e2dd461af (diff)
add and use name_list_cleanup() for cleaning up the string lists
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udevinfo.c')
-rw-r--r--udevinfo.c8
1 files changed, 3 insertions, 5 deletions
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[])