nvme: catch errors from nvme_configure_metadata()
authorHannes Reinecke <hare@suse.de>
Tue, 14 Nov 2023 13:27:01 +0000 (14:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:01:57 +0000 (17:01 +0100)
commit9514925a9abc4e26ce58ec93f70bfb565b53bd72
tree25dc0ef2e074ca30d4c67d6263ab50a6c48457a5
parent89fc9028e86e9968294ea4cb66d94fa7e5438871
nvme: catch errors from nvme_configure_metadata()

[ Upstream commit cd9aed606088d36a7ffff3e808db4e76b1854285 ]

nvme_configure_metadata() is issuing I/O, so we might incur an I/O
error which will cause the connection to be reset.
But in that case any further probing will race with reset and
cause UAF errors.
So return a status from nvme_configure_metadata() and abort
probing if there was an I/O error.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c