udev: fix error handling of sd_device_get_parent()
sd_device_get_parent() returns -EINVAL or -ENOENT on error, not -ENODEV. Fixes #16207.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user