summary refs log tree commit diff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-09-28 09:41:40 -0600
committerJens Axboe <axboe@kernel.dk>2018-09-28 09:41:40 -0600
commit133424a207774d3d32a38d560c6469ed31c0472f (patch)
treef045c6b55b668dfcdf02860ea3451c5a51694e6d
parent6c7678674014b4552caf0e5aa0ca34078a377482 (diff)
parentbb830add192e9d8338082c0fc2c209e23b43d865 (diff)
downloadlinux-133424a207774d3d32a38d560c6469ed31c0472f.tar.gz
Merge branch 'nvme-4.19' of git://git.infradead.org/nvme into for-linus
Pull NVMe fix from Christoph.

* 'nvme-4.19' of git://git.infradead.org/nvme:
  nvme: properly propagate errors in nvme_mpath_init
-rw-r--r--drivers/nvme/host/multipath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 5a9562881d4e..9fe3fff818b8 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -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)