nvme-multipath: Early exit if no path is available
authorDaniel Wagner <dwagner@suse.de>
Wed, 27 Jan 2021 10:30:33 +0000 (11:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:50 +0000 (23:28 +0100)
commitc9e668a196db3a286263c09ef420cec740686e4b
treeaf28967e3a3c39d36a0a02f61ba175b0fafc196c
parentcf7ed01e02c02fc696566509096073894b2fe24f
nvme-multipath: Early exit if no path is available

[ Upstream commit d1bcf006a9d3d63c1bcb65a993cb13756954cd9c ]

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: 75c10e732724 ("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>
drivers/nvme/host/multipath.c