Commit a61d2655 authored by Irvin Cote's avatar Irvin Cote Committed by Christoph Hellwig
Browse files

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: default avatarIrvin Cote <irvincoteg@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 37f0dc2e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3073,6 +3073,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;
}