]> www.infradead.org Git - nvme.git/commit
nvme: apple: fix device reference counting
authorKeith Busch <kbusch@kernel.org>
Tue, 4 Jun 2024 18:59:04 +0000 (11:59 -0700)
committerKeith Busch <kbusch@kernel.org>
Mon, 24 Jun 2024 19:53:41 +0000 (12:53 -0700)
commitb9ecbfa45516182cd062fecd286db7907ba84210
treee4db94bf2776b5213ffac5a3998659d96ded42d1
parent44348870de4b8f292f97b84583a298d66fbaf738
nvme: apple: fix device reference counting

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>
drivers/nvme/host/apple.c