From: Jens Axboe Date: Fri, 15 Dec 2017 20:34:22 +0000 (-0700) Subject: init: fix missing dlhandle reference put X-Git-Tag: fio-3.3~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=14dc963c6b8eaaf96f6310a21256368e9be49239 init: fix missing dlhandle reference put If we keep using the same engine, put the dlhandle reference that we now hold twice. Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index 03cdf902..f7d79c1c 100644 --- a/init.c +++ b/init.c @@ -1083,8 +1083,11 @@ int ioengine_load(struct thread_data *td) */ dlhandle = td->io_ops_dlhandle; ops = load_ioengine(td); - if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle) + if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle) { + if (dlhandle) + dlclose(dlhandle); return 0; + } if (dlhandle && dlhandle != td->io_ops_dlhandle) dlclose(dlhandle);