Skip to content

Commit 2d5d80d

Browse files
committed
fixup! libmpathutil: avoid segmentation violation in pthread_cancel()
1 parent bac92e5 commit 2d5d80d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

libmpathutil/runner.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ static int cancel_runner(struct runner_context *rctx)
132132
break;
133133
case RUNNER_RUNNING:
134134
pthread_cancel(rctx->thr);
135-
uatomic_set(&rctx->status, RUNNER_DEAD);
135+
assert(uatomic_cmpxchg(&rctx->status, RUNNER_CANCELLED,
136+
RUNNER_DEAD) == RUNNER_CANCELLED);
136137
st_new = RUNNER_CANCELLED;
137138
/* fallthrough */
138139
case RUNNER_CANCELLED:

0 commit comments

Comments
 (0)