From f63f7f3bbc49c72ee06f351bf3a7312df32f9e3c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sat, 1 Mar 2008 15:25:24 +0100 Subject: [PATCH] Fix potential crash in terminate_threads() td->io_ops can be NULL, if the thread is already gone. So copy the pointer and check before dereferencing it. Signed-off-by: Jens Axboe --- fio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fio.c b/fio.c index 1594bf64..d345064d 100644 --- a/fio.c +++ b/fio.c @@ -82,8 +82,12 @@ static void terminate_threads(int group_id) */ if (td->runstate < TD_RUNNING) kill(td->pid, SIGQUIT); - else if (td->io_ops->flags & FIO_SIGQUIT) - kill(td->pid, SIGQUIT); + else { + struct ioengine_ops *ops = td->io_ops; + + if (ops && (ops->flags & FIO_SIGQUIT)) + kill(td->pid, SIGQUIT); + } } } } -- 2.25.1