[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230322195639.1995821-35-sashal@kernel.org>
Date: Wed, 22 Mar 2023 15:56:29 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Irvin Cote <irvincoteg@...il.com>, Christoph Hellwig <hch@....de>,
Sasha Levin <sashal@...nel.org>, kbusch@...nel.org,
axboe@...com, sagi@...mberg.me, linux-nvme@...ts.infradead.org
Subject: [PATCH AUTOSEL 6.2 35/45] nvme-pci: fixing memory leak in probe teardown path
From: Irvin Cote <irvincoteg@...il.com>
[ Upstream commit a61d265533b7fe0026a02a49916aa564ffe38e4c ]
In case the nvme_probe teardown path is triggered the ctrl ref count does
not reach 0 thus creating a memory leak upon failure of nvme_probe.
Signed-off-by: Irvin Cote <irvincoteg@...il.com>
Signed-off-by: Christoph Hellwig <hch@....de>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/nvme/host/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index c11e0cfeef0f3..0a77242794d64 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3126,6 +3126,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
nvme_dev_unmap(dev);
out_uninit_ctrl:
nvme_uninit_ctrl(&dev->ctrl);
+ nvme_put_ctrl(&dev->ctrl);
return result;
}
--
2.39.2
Powered by blists - more mailing lists