summaryrefslogtreecommitdiffstats
path: root/src/rfkill
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-03-15 08:47:01 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-19 00:10:29 +0100
commit80a226b26b5e00a2ef9e85d1321da44cd14d051b (patch)
tree646e2bbb1a80fae9224dc3b3acba2b48668db705 /src/rfkill
parentlist: declare iterator of LIST_FOREACH() in the loop (diff)
downloadsystemd-80a226b26b5e00a2ef9e85d1321da44cd14d051b.tar.xz
systemd-80a226b26b5e00a2ef9e85d1321da44cd14d051b.zip
list: make LIST_FOREACH() and LIST_FOREACH_BACKWARDS() safer
Diffstat (limited to 'src/rfkill')
-rw-r--r--src/rfkill/rfkill.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c
index 7e8b8a27ef..656afa06ac 100644
--- a/src/rfkill/rfkill.c
+++ b/src/rfkill/rfkill.c
@@ -190,7 +190,7 @@ static int load_state(Context *c, const struct rfkill_event *event) {
static void save_state_queue_remove(Context *c, int idx, const char *state_file) {
assert(c);
- LIST_FOREACH_SAFE(queue, item, tmp, c->write_queue)
+ LIST_FOREACH(queue, item, c->write_queue)
if ((state_file && streq(item->file, state_file)) || idx == item->rfkill_idx) {
log_debug("Canceled previous save state of '%s' to %s.", one_zero(item->state), item->file);
LIST_REMOVE(queue, c->write_queue, item);