udev-node: make link_find_prioritized() return negative value when nothing found

Fixes a bug introduced by a2554acec6.

Fixes RHBZ#1662303.
This commit is contained in:
Yu Watanabe 2019-01-09 02:46:03 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent c501ecd70c
commit 82d9ac23fd
1 changed files with 3 additions and 0 deletions

View File

@ -181,6 +181,9 @@ static int link_find_prioritized(sd_device *dev, bool add, const char *stackdir,
priority = db_prio;
}
if (!target)
return -ENOENT;
*ret = TAKE_PTR(target);
return 0;
}