|
|
@@ -2253,11 +2253,13 @@ static void nvme_reset_work(struct work_struct *work)
|
|
|
struct nvme_dev *dev =
|
|
|
container_of(work, struct nvme_dev, ctrl.reset_work);
|
|
|
bool was_suspend = !!(dev->ctrl.ctrl_config & NVME_CC_SHN_NORMAL);
|
|
|
- int result = -ENODEV;
|
|
|
+ int result;
|
|
|
enum nvme_ctrl_state new_state = NVME_CTRL_LIVE;
|
|
|
|
|
|
- if (WARN_ON(dev->ctrl.state != NVME_CTRL_RESETTING))
|
|
|
+ if (WARN_ON(dev->ctrl.state != NVME_CTRL_RESETTING)) {
|
|
|
+ result = -ENODEV;
|
|
|
goto out;
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
|
* If we're called to reset a live controller first shut it down before
|
|
|
@@ -2355,6 +2357,7 @@ static void nvme_reset_work(struct work_struct *work)
|
|
|
if (!nvme_change_ctrl_state(&dev->ctrl, new_state)) {
|
|
|
dev_warn(dev->ctrl.device,
|
|
|
"failed to mark controller state %d\n", new_state);
|
|
|
+ result = -ENODEV;
|
|
|
goto out;
|
|
|
}
|
|
|
|