nvmet: release a ns reference in nvmet_req_uninit if needed
authorSagi Grimberg <sagi@grimberg.me>
Sun, 14 Jan 2018 16:34:22 +0000 (18:34 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 15 Jan 2018 16:09:32 +0000 (17:09 +0100)
commit423b4487fb23cc9bcbf14f748915bff46151506a
tree6e3e3f3451c52fff9bcfeb405d7e5141e7286431
parentdf351ef73789345b4b6c00434c5fd1fca7175643
nvmet: release a ns reference in nvmet_req_uninit if needed

nvmet_req_init looked up a namespace and took a reference on it (unless it
failed prior to that). If the request is uninitialized (in error cases) we
need to remove that reference in case it was taken, otherwise we leak
namespace reference when calling nvme_req_uninit.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c