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
This commit is contained in:
Dominique Martinet
2021-11-24 18:42:37 +01:00
committed by Lennart Poettering
parent 989db9b399
commit 3da361064b
+1 -1
View File
@@ -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;