nvme: multipath: fix return value of nvme_available_path
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.
Signed-off-by Uday Shankar <[email protected]>
--- drivers/nvme/host/multipath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/multipath.c +1 -1
@@ -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]>
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.
Reviewed-by Sagi Grimberg <[email protected]>