nvme-pci: clear the prp2 field when not used
authorLei Rao <lei.rao@intel.com>
Tue, 29 Nov 2022 09:48:11 +0000 (17:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Dec 2022 11:27:32 +0000 (12:27 +0100)
commit74b139c63f0775cf79266e9d9546c62b73fb3385
treedf21d6a8721e58be23b5e647e80de032ff7bb3d3
parent77ebf88e003140f10625d998b572ad1dde76d0c1
nvme-pci: clear the prp2 field when not used

[ Upstream commit a56ea6147facce4ac1fc38675455f9733d96232b ]

If the prp2 field is not filled in nvme_setup_prp_simple(), the prp2
field is garbage data. According to nvme spec, the prp2 is reserved if
the data transfer does not cross a memory page boundary, so clear it to
zero if it is not used.

Signed-off-by: Lei Rao <lei.rao@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/pci.c