Skip to content

Commit dbd5b3a

Browse files
Roman Rashchupkinpaboldin
authored andcommitted
Fix kpatch_process_init/kpatch_coroutines_free
1 parent 75702dc commit dbd5b3a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/kpatch_coro.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ void kpatch_coroutines_free(struct kpatch_process *proc)
622622
if (proc->coro.unwd)
623623
unw_destroy_addr_space(proc->coro.unwd);
624624

625-
list_for_each_entry_safe(c, tmp, &proc->coro.coros, list) {
626-
kpatch_coro_free(c);
627-
}
625+
if (!list_empty(&proc->coro.coros))
626+
list_for_each_entry_safe(c, tmp, &proc->coro.coros, list) {
627+
kpatch_coro_free(c);
628+
}
628629
}

src/kpatch_process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,10 +1121,10 @@ kpatch_process_init(kpatch_process_t *proc,
11211121
list_init(&proc->vmaholes);
11221122
proc->num_objs = 0;
11231123

1124-
if (process_get_comm(proc))
1125-
goto out_unlock;
11261124
if (kpatch_coroutines_init(proc))
11271125
goto out_unlock;
1126+
if (process_get_comm(proc))
1127+
goto out_unlock;
11281128

11291129
return 0;
11301130

0 commit comments

Comments
 (0)