Skip to content

Commit a61d265

Browse files
i-coteChristoph Hellwig
authored andcommitted
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 37f0dc2 commit a61d265

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,6 +3073,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
30733073
nvme_dev_unmap(dev);
30743074
out_uninit_ctrl:
30753075
nvme_uninit_ctrl(&dev->ctrl);
3076+
nvme_put_ctrl(&dev->ctrl);
30763077
return result;
30773078
}
30783079

0 commit comments

Comments
 (0)