1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 23:21:22 +03:00

sd-device: do not ignore critical errors in device_new_from_child()

This commit is contained in:
Yu Watanabe 2022-03-31 04:14:49 +09:00
parent 07c90f02d2
commit df88f02bb1

View File

@ -764,12 +764,16 @@ static int device_new_from_child(sd_device **ret, sd_device *child) {
}
_public_ int sd_device_get_parent(sd_device *child, sd_device **ret) {
int r;
assert_return(child, -EINVAL);
if (!child->parent_set) {
child->parent_set = true;
r = device_new_from_child(&child->parent, child);
if (r < 0 && r != -ENODEV)
return r;
(void) device_new_from_child(&child->parent, child);
child->parent_set = true;
}
if (!child->parent)