ioengines: fix crash with --enghelp option
authorVincent Fu <vincent.fu@samsung.com>
Wed, 4 Aug 2021 18:29:05 +0000 (18:29 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Aug 2021 18:49:57 +0000 (12:49 -0600)
commit2459bd33b3dbb7a34f28c612d595311a6bc7593d
tree08ea3b069e9730c29d73fd8ffa7b1e868ba859d1
parentda44720c9f8a138cf5351b0ebdd2ec74a80410f8
ioengines: fix crash with --enghelp option

Since f6931a1dd35896433c8cc2e10de51372a2c496c4 commands like the
following segfault:

fio --enghelp=sg
fio --enghelp=sg,sg_write_mode

This is because free_ioengine() assumes that td->io_ops is not NULL.
Make this true when free_ioengine() is called by
fio_show_ioengine_help() to avoid the crash.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
ioengines.c