]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme: apple: fix device reference counting
authorKeith Busch <kbusch@kernel.org>
Tue, 4 Jun 2024 18:59:04 +0000 (11:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:06 +0000 (15:34 +0200)
commitd59c4d0eb6adc24c2201f153ccb7fd0a335b0d3d
tree9dda71b95f90866b4804e524822f1f050197e335
parent04fb17e9f95bcc214ff29c5514ee9d3ec553ebe1
nvme: apple: fix device reference counting

[ Upstream commit b9ecbfa45516182cd062fecd286db7907ba84210 ]

Drivers must call nvme_uninit_ctrl after a successful nvme_init_ctrl.
Split the allocation side out to make the error handling boundary easier
to navigate. The apple driver had been doing this wrong, leaking the
controller device memory on a tagset failure.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/apple.c