Skip to content

Commit

Permalink
nvme: properly propagate errors in nvme_mpath_init
Browse files Browse the repository at this point in the history
Signed-off-by: Susobhan Dey <susobhan.dey@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Susobhan Dey authored and Christoph Hellwig committed Sep 25, 2018
1 parent be1277f commit bb830ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/nvme/host/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit bb830ad

Please sign in to comment.