]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: fix potential infinite loop
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 Apr 2021 13:36:12 +0000 (22:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 Apr 2021 16:38:47 +0000 (01:38 +0900)
src/udev/udev-builtin-net_id.c

index f4b200ea4233d6c71ca6b61ea1cfabe5290dd19d..f84c2669a85b719e4cf30f9a6ea6f962dce878ba 100644 (file)
@@ -395,8 +395,9 @@ static int dev_pci_slot(sd_device *dev, struct netnames *names) {
                         break;
                 }
 
-                if (sd_device_get_sysname(hotplug_slot_dev, &sysname) < 0)
-                        continue;
+                r = sd_device_get_sysname(hotplug_slot_dev, &sysname);
+                if (r < 0)
+                        return log_device_debug_errno(hotplug_slot_dev, r, "Failed to get sysname: %m");
 
                 FOREACH_DIRENT_ALL(dent, dir, break) {
                         _cleanup_free_ char *address = NULL;