Catch NULL td->o.ioengine
authorJens Axboe <axboe@kernel.dk>
Mon, 27 May 2013 07:50:31 +0000 (09:50 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 27 May 2013 07:50:31 +0000 (09:50 +0200)
This should not happen, except if there's a bug in the
option parsing (or profile, see commit 774a99b5). But
lets be cautious and catch it instead of seg faulting.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c

diff --git a/init.c b/init.c
index c44fa671aa9a3851da57270dd4b901ec272223be..70b56e38f21b5dab4c1789234d3ee226acabaed5 100644 (file)
--- a/init.c
+++ b/init.c
@@ -749,6 +749,10 @@ int ioengine_load(struct thread_data *td)
         */
        if (td->io_ops)
                return 0;
+       if (!td->o.ioengine) {
+               log_err("fio: internal fault, no IO engine specified\n");
+               return 1;
+       }
 
        engine = get_engine_name(td->o.ioengine);
        td->io_ops = load_ioengine(td, engine);