[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150128123106.05e28afc@gandalf.local.home>
Date: Wed, 28 Jan 2015 12:31:06 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Javi Merino <javi.merino@....com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
punit.agrawal@....com, broonie@...nel.org,
Zhang Rui <rui.zhang@...el.com>,
Eduardo Valentin <edubezval@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v1 5/7] thermal: add trace events to the power allocator
governor
On Wed, 28 Jan 2015 17:00:36 +0000
Javi Merino <javi.merino@....com> wrote:
> + if (trace_thermal_power_cpu_limit_enabled() && load_cpu) {
> + trace_thermal_power_cpu_get_power(
> + &cpufreq_device->allowed_cpus,
> + freq, load_cpu, i, dynamic_power, static_power);
> +
> + devm_kfree(&cdev->device, load_cpu);
You may want to move the devm_kfree() out of the
trace_thermal_power_cpu_limit_enabled() check. There could be a race
where that gets disabled while this function is running and you just
leaked memory.
if (load_cpu)
devm_kfree(&cdev->device, load_cpu);
should be done by itself.
-- Steve
> + }
>
> *power = static_power + dynamic_power;
> return 0;
> @@ -664,6 +689,8 @@ static int cpufreq_power2state(struct thermal_cooling_device *cdev,
> return -EINVAL;
> }
>
> + trace_thermal_power_cpu_limit(&cpufreq_device->allowed_cpus,
> + target_freq, *state, power);
> return 0;
> }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists