static void xnvme_fioe_cleanup(struct thread_data *td)
{
- struct xnvme_fioe_data *xd = td->io_ops_data;
+ struct xnvme_fioe_data *xd = NULL;
int err;
+ if (!td->io_ops_data)
+ return;
+
+ xd = td->io_ops_data;
+
err = pthread_mutex_lock(&g_serialize);
if (err)
log_err("ioeng->cleanup(): pthread_mutex_lock(), err(%d)\n", err);
/* NOTE: using the first device for buffer-allocators) */
static void xnvme_fioe_iomem_free(struct thread_data *td)
{
- struct xnvme_fioe_data *xd = td->io_ops_data;
- struct xnvme_fioe_fwrap *fwrap = &xd->files[0];
+ struct xnvme_fioe_data *xd = NULL;
+ struct xnvme_fioe_fwrap *fwrap = NULL;
+
+ if (!td->io_ops_data)
+ return;
+
+ xd = td->io_ops_data;
+ fwrap = &xd->files[0];
if (!fwrap->dev) {
log_err("ioeng->iomem_free(): failed no dev-handle\n");