Skip to contentSkip to conversation

nvme-multipath: Early exit if no path is available

PATCH Superseded Daniel Wagner 2 participants 3 messages Jan 22, 2021 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-multipath: Early exit if no path is available

nvme_round_robin_path() should test if the return ns pointer is valid. nvme_next_ns() will return a NULL pointer if there is no path left.

---
 drivers/nvme/host/multipath.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/multipath.c +2 -0
index d578de0ce3aa..8837e9da1ccf 100644
@@ -239,6 +239,8 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head,
 	for (ns = nvme_next_ns(head, old);
 	     ns != old;
 	     ns = nvme_next_ns(head, ns)) {
+		if (!ns)
+			break;
 		if (nvme_path_is_disabled(ns))
 			continue;
 
Signature · 7 lines
2.29.2


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