diff options
| author | Mark Stapp <mstapp@nvidia.com> | 2022-08-31 11:47:39 -0400 |
|---|---|---|
| committer | Mark Stapp <mstapp@nvidia.com> | 2022-08-31 11:47:39 -0400 |
| commit | 7e93a54c6c65cff58eb42d5f0f81bd9fac42af8d (patch) | |
| tree | 145aa2f8c33ba0542455ddc3756115299fd44daa | |
| parent | 9e7103f6b7515ac859ce0b61597129634cff6d3e (diff) | |
lib: ensure locals are inited to NULL
A couple of pointers in do_thread_cancel() we only inited at
the start of the function; make sure they're inited during
each iteration of the loop.
Signed-off-by: Mark Stapp <mstapp@nvidia.com>
| -rw-r--r-- | lib/thread.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c index c3613b5b0e..9eac9b410a 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -1354,9 +1354,9 @@ static void do_thread_cancel(struct thread_master *master) struct thread_list_head *list = NULL; struct thread **thread_array = NULL; struct thread *thread; - struct cancel_req *cr; struct listnode *ln; + for (ALL_LIST_ELEMENTS_RO(master->cancel_req, ln, cr)) { /* * If this is an event object cancellation, search @@ -1379,6 +1379,9 @@ static void do_thread_cancel(struct thread_master *master) if (!thread) continue; + list = NULL; + thread_array = NULL; + /* Determine the appropriate queue to cancel the thread from */ switch (thread->type) { case THREAD_READ: |
