Skip to content
Commit b6df5afc authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Greg Kroah-Hartman
Browse files

nvme-core: put ctrl ref when module ref get fail



commit 4bab6909 upstream.

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: 52a3974f "nvme-core: get/put ctrl and transport module in nvme_dev_open/release()"
Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 13e7ffa3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment