From: Dominique Martinet Date: Wed, 24 Nov 2021 13:27:22 +0000 (+0900) Subject: unit_is_bound_by_inactive: fix return pointer check X-Git-Tag: v250-rc1~171 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3da361064bf550d1818c7cd800a514326058e5f2;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/core/unit.c b/src/core/unit.c index fa21b8acb2f..e4f8bac442b 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;