]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: fix controller instance leak
authorKeith Busch <kbusch@kernel.org>
Wed, 26 Aug 2020 17:53:04 +0000 (10:53 -0700)
committerSagi Grimberg <sagi@grimberg.me>
Fri, 28 Aug 2020 23:43:57 +0000 (16:43 -0700)
commit297f339f059684d6216e31db7383b9b60ce9473e
treef3e67ba8d3dbb4d0a60ea54bc6956165a90ed7cd
parentd2ba192ebb7f2c9610d7ed2fb8c99d02df8e08c3
nvme: fix controller instance leak

If the driver has to unbind from the controller for an early failure
before the subsystem has been set up, there won't be a subsystem holding
the controller's instance, so the controller needs to free its own
instance in this case.

Fixes: 8555ffb883bb3 ("nvme: Assign subsys instance from first ctrl")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/host/core.c