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:
parent
2a71d57f4e
commit
bc568a7a35
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue