Skip to content

Commit 9d5aabd

Browse files
committed
runner: pause in cleanup handler if rctx is NULL
1 parent 23c02f4 commit 9d5aabd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

libmpathutil/runner.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <sched.h>
55
#include <time.h>
66
#include <pthread.h>
7+
#include <unistd.h>
78
#include <urcu/uatomic.h>
89
#include "util.h"
910
#include "debug.h"
@@ -44,8 +45,10 @@ static void cleanup_context(struct runner_context **prctx)
4445
struct runner_context *rctx = *prctx;
4546
int st;
4647

47-
if (!rctx)
48-
return;
48+
if (!rctx) {
49+
condlog(0, "ERROR: %s: rctx is NULL", __func__);
50+
pause();
51+
}
4952

5053
st = uatomic_cmpxchg(&rctx->status, RUNNER_RUNNING, RUNNER_DONE);
5154
/*

0 commit comments

Comments
 (0)