From: Yu Watanabe Date: Thu, 18 Jun 2020 04:48:44 +0000 (+0900) Subject: udev: fix error handling of sd_device_get_parent() X-Git-Tag: v246-rc1~137^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc568a7a35f04cb052eadcd068e14fe60f6a5c0d;p=thirdparty%2Fsystemd.git udev: fix error handling of sd_device_get_parent() sd_device_get_parent() returns -EINVAL or -ENOENT on error, not -ENODEV. Fixes #16207. --- diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index e1c3e430eaa..309cfebc8d2 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -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;