Skip to contentSkip to conversation

nvme-tcp-offload: Fix error code in nvme_tcp_ofld_create_ctrl()

PATCH New Dan Carpenter 1 participant 1 message Jun 9, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-tcp-offload: Fix error code in nvme_tcp_ofld_create_ctrl()

Return an error pointer if try_module_get() fails. Currently it returns NULL.

Fixes 4b8178ec5794 ("nvme-tcp-offload: Add device scan implementation")
---
 drivers/nvme/host/tcp-offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/tcp-offload.c +1 -1
index c76822e5ada7..c07f84a7e697 100644
@@ -1215,7 +1215,7 @@ nvme_tcp_ofld_create_ctrl(struct device *ndev, struct nvmf_ctrl_options *opts)
 	/* Increase driver refcnt */
 	if (!try_module_get(dev->ops->module)) {
 		pr_err("try_module_get failed\n");
-		dev = NULL;
+		rc = -ENODEV;
 		goto out_free_ctrl;
 	}
 
Signature · 7 lines
2.30.2


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme