diff options
author | Susobhan Dey <susobhan.dey@gmail.com> | 2018-09-25 21:29:15 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-09-26 01:21:40 +0200 |
commit | bb830add192e9d8338082c0fc2c209e23b43d865 (patch) | |
tree | a5a7343ba3cc588651752274cabb34b1ea84c4f1 | |
parent | nvme: count all ANA groups for ANA Log page (diff) | |
download | linux-bb830add192e9d8338082c0fc2c209e23b43d865.tar.xz linux-bb830add192e9d8338082c0fc2c209e23b43d865.zip |
nvme: properly propagate errors in nvme_mpath_init
Signed-off-by: Susobhan Dey <susobhan.dey@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/nvme/host/multipath.c | 6 |
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) |