]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: fix error handling of sd_device_get_parent()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 Jun 2020 04:48:44 +0000 (13:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 Jun 2020 04:52:38 +0000 (13:52 +0900)
sd_device_get_parent() returns -EINVAL or -ENOENT on error, not -ENODEV.

Fixes #16207.

src/udev/udev-event.c

index e1c3e430eaa119bba2d535e39b4e5fe07225be96..309cfebc8d29e5035c57d6bbab55b699da747190 100644 (file)
@@ -370,7 +370,7 @@ static ssize_t udev_event_subst_format(
         }
         case FORMAT_SUBST_PARENT:
                 r = sd_device_get_parent(dev, &parent);
-                if (r == -ENODEV)
+                if (r == -ENOENT)
                         goto null_terminate;
                 if (r < 0)
                         return r;