summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-01-09 02:46:03 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-01-08 19:21:44 +0100
commit82d9ac23fd5ab2befe2a95187640a8d38799dd64 (patch)
treef02a01e50895dcb7b529edd548345d77234e4ce9 /src
parentc501ecd70c61f5569bb775be62612521aa53f878 (diff)
downloadsystemd-82d9ac23fd5ab2befe2a95187640a8d38799dd64.tar.gz
udev-node: make link_find_prioritized() return negative value when nothing found
Fixes a bug introduced by a2554acec652fc65c8ed0c6c1fede9ba8c3693b1. Fixes RHBZ#1662303.
Diffstat (limited to 'src')
-rw-r--r--src/udev/udev-node.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index c11eb8c1ac..c77010c09b 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -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;
}