diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index a56a1e0432e7becfdaa3d30cfd8510e4006caa9f..df525ab42fcd18c17bb55f4bbadb1dd52a12e1bf 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1891,7 +1891,7 @@ static int nvme_dev_open(struct inode *inode, struct file *file) struct nvme_ctrl *ctrl = container_of(inode->i_cdev, struct nvme_ctrl, cdev); - if (!ctrl->admin_q) + if (ctrl->state != NVME_CTRL_LIVE) return -EWOULDBLOCK; file->private_data = ctrl; return 0;