Skip to contentSkip to conversation

nvme: uninitialized return in nvme_ns_head_chr_uring_cmd()

PATCH In review Dan Carpenter 2 participants 2 messages May 9, 2022 – May 10, 2022

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

PATCH 1/1 nvme: uninitialized return in nvme_ns_head_chr_uring_cmd()

The "ret" value is not set if "ns" is zero.

Fixes 86116c2f6fee ("nvme: wire-up uring-cmd support for io-passthru on char-device.")
---
 drivers/nvme/host/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/ioctl.c +1 -1
index 4b91e452768b..c118559d47f0 100644
@@ -688,7 +688,7 @@ int nvme_ns_head_chr_uring_cmd(struct io_uring_cmd *ioucmd,
 	struct nvme_ns_head *head = container_of(cdev, struct nvme_ns_head, cdev);
 	int srcu_idx = srcu_read_lock(&head->srcu);
 	struct nvme_ns *ns = nvme_find_path(head);
-	int ret;
+	int ret = 0;
 
 	if (ns)
 		ret = nvme_ns_uring_cmd(ns, ioucmd, issue_flags);
Signature · 1 line
2.35.1