aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrvin Cote <irvincoteg@gmail.com>2023-03-08 18:05:08 -0300
committerChristoph Hellwig <hch@lst.de>2023-03-15 14:58:51 +0100
commita61d265533b7fe0026a02a49916aa564ffe38e4c (patch)
treecc313de1e1dcc0d387a6b7ddc7bc35c40ea3d787
parent37f0dc2ec78af0c3f35dd05578763de059f6fe77 (diff)
downloadspi-a61d265533b7fe0026a02a49916aa564ffe38e4c.tar.gz
nvme-pci: fixing memory leak in probe teardown path
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@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/nvme/host/pci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 5b95c94ee40f20..e77a8a873b1ae2 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3073,6 +3073,7 @@ out_dev_unmap:
nvme_dev_unmap(dev);
out_uninit_ctrl:
nvme_uninit_ctrl(&dev->ctrl);
+ nvme_put_ctrl(&dev->ctrl);
return result;
}