Skip to content

Commit c9e668a

Browse files
dwsusegregkh
authored andcommitted
nvme-multipath: Early exit if no path is available
[ Upstream commit d1bcf00 ] 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. Fixes: 75c10e7 ("nvme-multipath: round-robin I/O policy") Signed-off-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cf7ed01 commit c9e668a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/nvme/host/multipath.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static struct nvme_ns *nvme_round_robin_path(struct nvme_ns_head *head,
221221
}
222222

223223
for (ns = nvme_next_ns(head, old);
224-
ns != old;
224+
ns && ns != old;
225225
ns = nvme_next_ns(head, ns)) {
226226
if (nvme_path_is_disabled(ns))
227227
continue;

0 commit comments

Comments
 (0)