diff options
| author | Wen Yang <[email protected]> | 2019-02-27 04:40:38 +0000 |
|---|---|---|
| committer | Lorenzo Pieralisi <[email protected]> | 2019-04-01 09:39:17 +0000 |
| commit | b35c0e4543945fe9b21e6ed9ab72cdb5efb30718 (patch) | |
| tree | 5154313985b67ce46dc8fa1d20b98d8d868ae19e /drivers/pci/controller/dwc | |
| parent | PCI: uniphier: Fix a leaked reference by adding missing of_node_put() (diff) | |
| download | kernel-b35c0e4543945fe9b21e6ed9ab72cdb5efb30718.tar.gz kernel-b35c0e4543945fe9b21e6ed9ab72cdb5efb30718.zip | |
PCI: dwc: layerscape: Fix a leaked reference by adding missing of_node_put()
The call to of_parse_phandle() returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.
Detected by coccinelle with the following warnings:
./drivers/pci/controller/dwc/pci-layerscape.c:204:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 198, but without a corresponding object release within this function.
Signed-off-by: Wen Yang <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Cc: Minghuan Lian <[email protected]>
Cc: Mingkai Hu <[email protected]>
Cc: Roy Zang <[email protected]>
Cc: Lorenzo Pieralisi <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Diffstat (limited to 'drivers/pci/controller/dwc')
| -rw-r--r-- | drivers/pci/controller/dwc/pci-layerscape.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index ce45bde29bf8..3a5fa26d5e56 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c @@ -201,6 +201,7 @@ static int ls_pcie_msi_host_init(struct pcie_port *pp) return -EINVAL; } + of_node_put(msi_node); return 0; } |
