discover/udev: NULL return from udev_enumerate_get_list_entry isn't an error
authorJeremy Kerr <jk@ozlabs.org>
Thu, 17 Apr 2014 03:47:39 +0000 (11:47 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 17 Apr 2014 03:50:39 +0000 (11:50 +0800)
A NULL return can mean the list is empty; don't return a failure from
this case.

udev_list_entry_foreach does a check for a NULL entry, so we'll do the
correct thing in the following loop.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/udev.c

index 00b6df78c18cecbf119bf0729f030efeed12ed0d..6ccb8d4ba42917aed8669cf4e78bff03cc500a6e 100644 (file)
@@ -321,11 +321,6 @@ static int udev_enumerate(struct udev *udev)
 
        list = udev_enumerate_get_list_entry(enumerate);
 
 
        list = udev_enumerate_get_list_entry(enumerate);
 
-       if (!list) {
-               pb_log("udev_enumerate_get_list_entry failed\n");
-               goto fail;
-       }
-
        udev_list_entry_foreach(entry, list) {
                const char *syspath;
                struct udev_device *dev;
        udev_list_entry_foreach(entry, list) {
                const char *syspath;
                struct udev_device *dev;