diff options
author | Wang Qing <wangqing@vivo.com> | 2021-12-13 12:42:24 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2022-04-21 14:47:15 +0300 |
commit | 883f464c1d23663047eda4f2bcf622365e2d0dd0 (patch) | |
tree | 3f95b562f739e90ed02ea48ea451c2e7792eb378 /arch/arm/mach-omap2/prm_common.c | |
parent | 71ff461c3f41f6465434b9e980c01782763e7ad8 (diff) | |
download | linux-883f464c1d23663047eda4f2bcf622365e2d0dd0.tar.xz |
ARM: OMAP2+: add missing of_node_put before break and return
Fix following coccicheck warning:
WARNING: Function "for_each_matching_node_and_match"
should have of_node_put() before return.
Early exits from for_each_matching_node_and_match should decrement the
node reference counter.
Signed-off-by: Wang Qing <wangqing@vivo.com>
Message-Id: <1639388545-63615-1-git-send-email-wangqing@vivo.com>
[tony@atomide.com: updated for omap_hwmod.c that was already patched]
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm_common.c')
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 65b2d82efa27..fb2d48cfe756 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -752,8 +752,10 @@ int __init omap2_prm_base_init(void) data = (struct omap_prcm_init_data *)match->data; ret = of_address_to_resource(np, 0, &res); - if (ret) + if (ret) { + of_node_put(np); return ret; + } data->mem = ioremap(res.start, resource_size(&res)); @@ -799,8 +801,10 @@ int __init omap_prcm_init(void) data = match->data; ret = omap2_clk_provider_init(np, data->index, NULL, data->mem); - if (ret) + if (ret) { + of_node_put(np); return ret; + } } omap_cm_init(); |