fio: fix dlopen refcounting of dynamic engines
[fio.git] / init.c
diff --git a/init.c b/init.c
index ab38b334a9195b089d686785c9ec0d0d02d17dc4..d6dbaf7cb437d894ab990fa4531bd44ef05872c7 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1109,11 +1109,8 @@ int ioengine_load(struct thread_data *td)
                if (!ops)
                        goto fail;
 
-               if (ops == td->io_ops && dlhandle == td->io_ops->dlhandle) {
-                       if (dlhandle)
-                               dlclose(dlhandle);
+               if (ops == td->io_ops && dlhandle == td->io_ops->dlhandle)
                        return 0;
-               }
 
                if (dlhandle && dlhandle != td->io_ops->dlhandle)
                        dlclose(dlhandle);