mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
nvme: fix an error code in nvme_init_subsystem()
"ret" should be a negative error code here, but it's either success or
possibly uninitialized.
Fixes: 32fd90c407
("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>
This commit is contained in:
parent
7cbb5c6f9a
commit
bc4f6e06a9
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue