mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
Merge branch 'pci/ptm'
- Fix leaks of ptm_debugfs in pcie_ptm_create_debugfs() and pcie_ptm_destroy_debugfs() (Aadityarangan Shridhar Iyengar) * pci/ptm: PCI/PTM: Fix pcie_ptm_create_debugfs() memory leak
This commit is contained in:
commit
65a5ac66cd
|
|
@ -542,8 +542,10 @@ struct pci_ptm_debugfs *pcie_ptm_create_debugfs(struct device *dev, void *pdata,
|
|||
return NULL;
|
||||
|
||||
dirname = devm_kasprintf(dev, GFP_KERNEL, "pcie_ptm_%s", dev_name(dev));
|
||||
if (!dirname)
|
||||
if (!dirname) {
|
||||
kfree(ptm_debugfs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptm_debugfs->debugfs = debugfs_create_dir(dirname, NULL);
|
||||
ptm_debugfs->pdata = pdata;
|
||||
|
|
@ -574,6 +576,7 @@ void pcie_ptm_destroy_debugfs(struct pci_ptm_debugfs *ptm_debugfs)
|
|||
|
||||
mutex_destroy(&ptm_debugfs->lock);
|
||||
debugfs_remove_recursive(ptm_debugfs->debugfs);
|
||||
kfree(ptm_debugfs);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pcie_ptm_destroy_debugfs);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user