diff --git a/src/udev/udevadm-util.c b/src/udev/udevadm-util.c index 4081976ca3..2447edad19 100644 --- a/src/udev/udevadm-util.c +++ b/src/udev/udevadm-util.c @@ -72,6 +72,10 @@ int find_device(const char *id, const char *prefix, sd_device **ret) { return 0; } + /* if a path is provided, then it cannot be a unit name. Let's return earlier. */ + if (is_path(id)) + return -ENODEV; + /* Check if the argument looks like a device unit name. */ return find_device_from_unit(id, ret); }