Skip to contentSkip to conversation

NVMe wrong return value if read log fails

PATCH New Susobhan Dey 2 participants 2 messages Sep 25, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NVMe wrong return value if read log fails

Signed-off-by Susobhan Dey <susobhan.dey at gmail.com>
---
 drivers/nvme/host/multipath.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nvme/host/multipath.c +4 -2
index 5a9562881d4e..9fe3fff818b8 100644
@@ -537,8 +537,10 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
 
 	INIT_WORK(&ctrl->ana_work, nvme_ana_work);
 	ctrl->ana_log_buf = kmalloc(ctrl->ana_log_size, GFP_KERNEL);
-	if (!ctrl->ana_log_buf)
+	if (!ctrl->ana_log_buf) {
+		error = -ENOMEM;
 		goto out;
+	}
 
 	error = nvme_read_ana_log(ctrl, true);
 	if (error)
@@ -547,7 +549,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
 out_free_ana_log_buf:
 	kfree(ctrl->ana_log_buf);
 out:
-	return -ENOMEM;
+	return error;
 }
 
 void nvme_mpath_uninit(struct nvme_ctrl *ctrl)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 NVMe wrong return value if read log fails

Thanks,

applied to nvme-4.19.