summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2021-11-24 22:27:22 +0900
committerLennart Poettering <lennart@poettering.net>2021-11-24 18:42:37 +0100
commit3da361064bf550d1818c7cd800a514326058e5f2 (patch)
tree90fa9a88e08d83f9eb0d0735c0cc850d56f45b11 /src
parent989db9b399fb69bd6b991180a1f2d801124fdbd7 (diff)
downloadsystemd-3da361064bf550d1818c7cd800a514326058e5f2.tar.gz
unit_is_bound_by_inactive: fix return pointer check
*ret_culprit should be set if ret_culprit has been passed a non-null value, checking the previous *ret_culprit value does not make sense. This would cause the culprit to not properly be assigned, leading to pid1 crash when a unit could not be stopped. Fixes: #21476
Diffstat (limited to 'src')
-rw-r--r--src/core/unit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index fa21b8acb2..e4f8bac442 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2129,7 +2129,7 @@ bool unit_is_bound_by_inactive(Unit *u, Unit **ret_culprit) {
continue;
if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other))) {
- if (*ret_culprit)
+ if (ret_culprit)
*ret_culprit = other;
return true;