diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-29 20:28:34 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-05-30 03:00:29 +0200 |
commit | e4ab2db9df997e2c7d788440fbfe645b2d816306 (patch) | |
tree | 04b631515a109c531f015bfbdd5b8bb4fb3ef856 | |
parent | bpf: stabilize GCC BPF support (diff) | |
download | systemd-e4ab2db9df997e2c7d788440fbfe645b2d816306.tar.xz systemd-e4ab2db9df997e2c7d788440fbfe645b2d816306.zip |
home: move the assert back to the intended place
98d81cf974 moved the assertion at the beginning of home_dispatch_acquire(),
which is however before we even check for any ongoing operation, hence we
might hit it even in legitimate cases.
Let's move it back to after we check for any possibly ongoing operation, to
make it once again a safety check.
Follow-up to 98d81cf974.
Resolves: #22443 and #24036
-rw-r--r-- | src/home/homed-home.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/home/homed-home.c b/src/home/homed-home.c index d16509d574..a79a719383 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -2681,8 +2681,6 @@ static int home_dispatch_acquire(Home *h, Operation *o) { assert(o); assert(o->type == OPERATION_ACQUIRE); - assert(!h->current_operation); - switch (home_get_state(h)) { case HOME_UNFIXATED: @@ -2718,6 +2716,8 @@ static int home_dispatch_acquire(Home *h, Operation *o) { return 0; } + assert(!h->current_operation); + r = home_ratelimit(h, &error); if (r >= 0) r = call(h, o->secret, for_state, &error); |