mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
powerpc/iommu: Add missing of_node_put in iommu_init_early_dart
[ Upstream commit 57b742a5b8
]
The device_node pointer is returned by of_find_compatible_node
with refcount incremented. We should use of_node_put() to avoid
the refcount leak.
Signed-off-by: Peng Wu <wupeng58@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220425081245.21705-1-wupeng58@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7cb1a4f597
commit
82ee6bf993
1 changed files with 4 additions and 2 deletions
|
@ -404,9 +404,10 @@ void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
|
|||
}
|
||||
|
||||
/* Initialize the DART HW */
|
||||
if (dart_init(dn) != 0)
|
||||
if (dart_init(dn) != 0) {
|
||||
of_node_put(dn);
|
||||
return;
|
||||
|
||||
}
|
||||
/*
|
||||
* U4 supports a DART bypass, we use it for 64-bit capable devices to
|
||||
* improve performance. However, that only works for devices connected
|
||||
|
@ -419,6 +420,7 @@ void __init iommu_init_early_dart(struct pci_controller_ops *controller_ops)
|
|||
|
||||
/* Setup pci_dma ops */
|
||||
set_pci_dma_ops(&dma_iommu_ops);
|
||||
of_node_put(dn);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
|
Loading…
Add table
Reference in a new issue