Skip to content

Commit

Permalink
nvme: fix an error code in nvme_init_subsystem()
Browse files Browse the repository at this point in the history
"ret" should be a negative error code here, but it's either success or
possibly uninitialized.

Fixes: 32fd90c ("nvme: change locking for the per-subsystem controller list")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
  • Loading branch information
Dan Carpenter authored and Sagi Grimberg committed Sep 25, 2019
1 parent 7cbb5c6 commit bc4f6e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2543,8 +2543,9 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
list_add_tail(&subsys->entry, &nvme_subsystems);
}

if (sysfs_create_link(&subsys->dev.kobj, &ctrl->device->kobj,
dev_name(ctrl->device))) {
ret = sysfs_create_link(&subsys->dev.kobj, &ctrl->device->kobj,
dev_name(ctrl->device));
if (ret) {
dev_err(ctrl->device,
"failed to create sysfs link from subsystem.\n");
goto out_put_subsystem;
Expand Down

0 comments on commit bc4f6e0

Please sign in to comment.