lkml.org 
[lkml]   [2019]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] cpufreq: ppc_cbe: fix possible object reference leak


On Tue, 2 Apr 2019, Markus Elfring wrote:

> > @@ -86,6 +86,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy)
> > if (!cbe_get_cpu_pmd_regs(policy->cpu) ||
> > !cbe_get_cpu_mic_tm_regs(policy->cpu)) {
> > pr_info("invalid CBE regs pointers for cpufreq\n");
> > + of_node_put(cpu);
> > return -EINVAL;
> > }
>
> I have taken another look at the implementation of this function.
> I find that the second statement “return -EINVAL” would need related
> source code adjustments.
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cpufreq/ppc_cbe_cpufreq.c?id=05d08e2995cbe6efdb993482ee0d38a77040861a#n96
>
> How do you think about to complete the exception handling here?

There is an of_node_put two lines above.

julia
\
 
 \ /
  Last update: 2019-04-02 15:16    [W:0.065 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site