If we keep using the same engine, put the dlhandle reference that
we now hold twice.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
*/
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);