blob: 498371f9038d861dd39f1d80135de76f73d8218b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
From 3bb94257935dabcb8853fd7e687d31f432013922 Mon Sep 17 00:00:00 2001
From: Dominique Martinet <asmadeus@codewreck.org>
Date: Wed, 24 Nov 2021 22:27:22 +0900
Subject: [PATCH 20/20] 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
(cherry picked from commit 3da361064bf550d1818c7cd800a514326058e5f2)
---
src/core/unit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 38d3eb703f88..c792bd8e826b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2118,7 +2118,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;
--
2.31.1
|