From: Irvin Cote Date: Wed, 8 Mar 2023 21:05:08 +0000 (-0300) Subject: nvme-pci: fixing memory leak in probe teardown path X-Git-Tag: v6.3-rc3~14^2~1^2~6 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a61d265533b7fe0026a02a49916aa564ffe38e4c;p=tomoyo%2Ftomoyo-test1.git 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 Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 5b95c94ee40f..e77a8a873b1a 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; }