diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-03-09 09:17:10 +0000 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2022-03-14 15:01:51 +0100 |
commit | 4528668ca331f7ce5999b7746657b46db5b3b785 (patch) | |
tree | 3284d151257ae1567dacdd58f98860531f240c46 /drivers/bus | |
parent | 3f059a7e8c13c62addc1808d13a41d1f6dc24bd1 (diff) | |
download | linux-4528668ca331f7ce5999b7746657b46db5b3b785.tar.gz linux-4528668ca331f7ce5999b7746657b46db5b3b785.tar.bz2 linux-4528668ca331f7ce5999b7746657b46db5b3b785.zip |
mips: cdmm: Fix refcount leak in mips_cdmm_phys_base
The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.
Fixes: 2121aa3e2312 ("mips: cdmm: Add mti,mips-cdmm dtb node support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/mips_cdmm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c index 626dedd110cb..fca0d0669aa9 100644 --- a/drivers/bus/mips_cdmm.c +++ b/drivers/bus/mips_cdmm.c @@ -351,6 +351,7 @@ phys_addr_t __weak mips_cdmm_phys_base(void) np = of_find_compatible_node(NULL, NULL, "mti,mips-cdmm"); if (np) { err = of_address_to_resource(np, 0, &res); + of_node_put(np); if (!err) return res.start; } |