]> git.ipfire.org Git - people/arne_f/kernel.git/commit
nvme: fix srcu locking on error return in nvme_get_ns_from_disk
authorChristoph Hellwig <hch@lst.de>
Fri, 17 May 2019 09:47:33 +0000 (02:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jun 2019 06:18:02 +0000 (08:18 +0200)
commita6515af9b839475e862e4486f8f3d8e859e10983
treeb1877e2075d0f72fb2f7f40e29318664d94a8085
parentc4e97af6bff4bdb20c4cb1760914c2f635c82ffc
nvme: fix srcu locking on error return in nvme_get_ns_from_disk

[ Upstream commit 100c815cbd56480b3e31518475b04719c363614a ]

If we can't get a namespace don't leak the SRCU lock.  nvme_ioctl was
working around this, but nvme_pr_command wasn't handling this properly.
Just do what callers would usually expect.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/core.c