nvme: fix an error code in nvme_init_subsystem()
Subsystems (2)
PATCH 1/1 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 32fd90c40768 ("nvme: change locking for the per-subsystem controller list")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +3 -2
@@ -2540,8 +2540,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;
Signature · 1 line
2.20.1
Quoted 5 lines · Dan Carpenter
"ret" should be a negative error code here, but it's either success or possibly uninitialized.
Fixes 32fd90c40768 ("nvme: change locking for the per-subsystem controller list")Signed-off-by Dan Carpenter <[email protected]>
Thanks, patch looks good.
Reviewed-by Keith Busch <[email protected]>
Looks good,
Reviewed-by Christoph Hellwig <[email protected]>