Maybe a better idea: move device_initialize() to the very beginning of nvme_init_ctrl() initialize ctrl->instance to a negative value, so we can check in the .release() method if we have to call ida_free() or not. Now all the fabrics drivers know that in case of error they have to execute nvme_put_ctrl(). Could it work? Maurizio