Skip to contentSkip to conversation

nvme: multipath: fix return value of nvme_available_path

PATCH Applied Uday Shankar 3 participants 3 messages Apr 4, 2025 – Apr 13, 2025 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: multipath: fix return value of nvme_available_path

The function returns bool so we should return false, not NULL. No functional changes are expected.

---
 drivers/nvme/host/multipath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/multipath.c +1 -1
index 6b12ca80aa27305a759990348c4c107655664d94..94152cf423f165aaba9cbb57f370ef4708365f1a 100644
@@ -427,7 +427,7 @@ static bool nvme_available_path(struct nvme_ns_head *head)
 	struct nvme_ns *ns;
 
 	if (!test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags))
-		return NULL;
+		return false;
 
 	list_for_each_entry_srcu(ns, &head->list, siblings,
 				 srcu_read_lock_held(&head->srcu)) {

---
base-commit: 0514a1379e11c6b8038674f43a478b0857d47a5e
change-id: 20250404-nvme_type-a8d541eff3da

Best regards,

Signature · 1 line
Uday Shankar <[email protected]>
maintainer Applied
#1 lore raw
Quoted 2 lines · Uday Shankar

The function returns bool so we should return false, not NULL. No functional changes are expected.

Thanks,

applied to nvme-6.15.

I'm a bit surprised this didn't generate a sparse warning similar to when 0 is used in pointer context, but I guess that is because of the implicit conversion of boolean expressions to the bool type.