mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
cxl: Fix refcount leak in cxl_calc_capp_routing
[ Upstream commit1d09697ff2
] of_get_next_parent() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. This function only calls of_node_put() in normal path, missing it in the error path. Add missing of_node_put() to avoid refcount leak. Fixes:f24be42aab
("cxl: Add psl9 specific code") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by: Andrew Donnellan <ajd@linux.ibm.com> Acked-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220605060038.62217-1-linmq006@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f4ad0a7f0e
commit
c9bebc5038
1 changed files with 1 additions and 0 deletions
|
@ -395,6 +395,7 @@ int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid,
|
||||||
rc = get_phb_index(np, phb_index);
|
rc = get_phb_index(np, phb_index);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err("cxl: invalid phb index\n");
|
pr_err("cxl: invalid phb index\n");
|
||||||
|
of_node_put(np);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue