]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-core: put ctrl ref when module ref get fail
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Tue, 6 Oct 2020 23:36:47 +0000 (16:36 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 7 Oct 2020 05:55:40 +0000 (07:55 +0200)
commit5ac497118b35bc84f89e9fedc975a868c52ca783
tree890428417257ef8a9107a860c2a8af5c8d6c7982
parent2f2843da6cb55422dbf27206fadade2c314379a3
nvme-core: put ctrl ref when module ref get fail

When try_module_get() fails in the nvme_dev_open() it returns without
releasing the ctrl reference which was taken earlier.

Put the ctrl reference which is taken before calling the
try_module_get() in the error return code path.

Fixes: 3f24ffdc68c3 "nvme-core: get/put ctrl and transport module in nvme_dev_open/release()"
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c