• Wen Yang's avatar
    cpufreq: kirkwood: fix possible object reference leak · 0c049043
    Wen Yang authored
    [ Upstream commit 7c468966f05ac9c17bb5948275283d34e6fe0660 ]
    
    The call to of_get_child_by_name 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/cpufreq/kirkwood-cpufreq.c:127:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 118, but without a corresponding object release within this function.
    ./drivers/cpufreq/kirkwood-cpufreq.c:133:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 118, but without a corresponding object release within this function.
    
    and also do some cleanup:
    - of_node_put(np);
    - np = NULL;
    ...
    of_node_put(np);
    Signed-off-by: default avatarWen Yang <wen.yang99@zte.com.cn>
    Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
    Cc: Viresh Kumar <viresh.kumar@linaro.org>
    Cc: linux-pm@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    0c049043
Name
Last commit
Last update
..
Kconfig Loading commit data...
Kconfig.arm Loading commit data...
Kconfig.powerpc Loading commit data...
Kconfig.x86 Loading commit data...
Makefile Loading commit data...
acpi-cpufreq.c Loading commit data...
amd_freq_sensitivity.c Loading commit data...
arm_big_little.c Loading commit data...
arm_big_little.h Loading commit data...
arm_big_little_dt.c Loading commit data...
at32ap-cpufreq.c Loading commit data...
blackfin-cpufreq.c Loading commit data...
bmips-cpufreq.c Loading commit data...
brcmstb-avs-cpufreq.c Loading commit data...
cppc_cpufreq.c Loading commit data...
cpufreq-dt-platdev.c Loading commit data...
cpufreq-dt.c Loading commit data...
cpufreq-dt.h Loading commit data...
cpufreq-nforce2.c Loading commit data...
cpufreq.c Loading commit data...
cpufreq_conservative.c Loading commit data...
cpufreq_governor.c Loading commit data...
cpufreq_governor.h Loading commit data...
cpufreq_governor_attr_set.c Loading commit data...
cpufreq_ondemand.c Loading commit data...
cpufreq_ondemand.h Loading commit data...
cpufreq_performance.c Loading commit data...
cpufreq_powersave.c Loading commit data...
cpufreq_stats.c Loading commit data...
cpufreq_userspace.c Loading commit data...
cris-artpec3-cpufreq.c Loading commit data...
cris-etraxfs-cpufreq.c Loading commit data...
davinci-cpufreq.c Loading commit data...
e_powersaver.c Loading commit data...
elanfreq.c Loading commit data...
exynos5440-cpufreq.c Loading commit data...
freq_table.c Loading commit data...
gx-suspmod.c Loading commit data...
highbank-cpufreq.c Loading commit data...
ia64-acpi-cpufreq.c Loading commit data...
imx6q-cpufreq.c Loading commit data...
intel_pstate.c Loading commit data...
kirkwood-cpufreq.c Loading commit data...
longhaul.c Loading commit data...
longhaul.h Loading commit data...
longrun.c Loading commit data...
loongson1-cpufreq.c Loading commit data...
loongson2_cpufreq.c Loading commit data...
maple-cpufreq.c Loading commit data...
mediatek-cpufreq.c Loading commit data...
mvebu-cpufreq.c Loading commit data...
omap-cpufreq.c Loading commit data...
p4-clockmod.c Loading commit data...
pasemi-cpufreq.c Loading commit data...
pcc-cpufreq.c Loading commit data...
pmac32-cpufreq.c Loading commit data...
pmac64-cpufreq.c Loading commit data...
powernow-k6.c Loading commit data...
powernow-k7.c Loading commit data...
powernow-k7.h Loading commit data...
powernow-k8.c Loading commit data...
powernow-k8.h Loading commit data...
powernv-cpufreq.c Loading commit data...
ppc_cbe_cpufreq.c Loading commit data...
ppc_cbe_cpufreq.h Loading commit data...
ppc_cbe_cpufreq_pervasive.c Loading commit data...
ppc_cbe_cpufreq_pmi.c Loading commit data...
pxa2xx-cpufreq.c Loading commit data...
pxa3xx-cpufreq.c Loading commit data...
qoriq-cpufreq.c Loading commit data...
s3c2410-cpufreq.c Loading commit data...
s3c2412-cpufreq.c Loading commit data...
s3c2416-cpufreq.c Loading commit data...
s3c2440-cpufreq.c Loading commit data...
s3c24xx-cpufreq-debugfs.c Loading commit data...
s3c24xx-cpufreq.c Loading commit data...
s3c64xx-cpufreq.c Loading commit data...
s5pv210-cpufreq.c Loading commit data...
sa1100-cpufreq.c Loading commit data...
sa1110-cpufreq.c Loading commit data...
sc520_freq.c Loading commit data...
scpi-cpufreq.c Loading commit data...
sfi-cpufreq.c Loading commit data...
sh-cpufreq.c Loading commit data...
sparc-us2e-cpufreq.c Loading commit data...
sparc-us3-cpufreq.c Loading commit data...
spear-cpufreq.c Loading commit data...
speedstep-centrino.c Loading commit data...
speedstep-ich.c Loading commit data...
speedstep-lib.c Loading commit data...
speedstep-lib.h Loading commit data...
speedstep-smi.c Loading commit data...
sti-cpufreq.c Loading commit data...
tango-cpufreq.c Loading commit data...
tegra124-cpufreq.c Loading commit data...
tegra186-cpufreq.c Loading commit data...
tegra20-cpufreq.c Loading commit data...
ti-cpufreq.c Loading commit data...
unicore2-cpufreq.c Loading commit data...
vexpress-spc-cpufreq.c Loading commit data...