[PATCH] cpu: cpufreq: fix leak of dir before we return

Keng-Yu Lin kengyu at canonical.com
Thu May 9 06:36:31 UTC 2013


On Tue, May 7, 2013 at 5:33 AM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Coverity CID #997352, Resource leak.
>
> Need to closedir before we return.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/cpu/cpufreq/cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/cpu/cpufreq/cpufreq.c b/src/cpu/cpufreq/cpufreq.c
> index 5133f51..df52100 100644
> --- a/src/cpu/cpufreq/cpufreq.c
> +++ b/src/cpu/cpufreq/cpufreq.c
> @@ -495,6 +495,7 @@ static void do_sw_any_test(fwts_framework *fw)
>         if (get_performance_repeat(fw, first_cpu_index, 5, GET_PERFORMANCE_MIN, &lowperf) != FWTS_OK) {
>                 fwts_failed(fw, LOG_LEVEL_MEDIUM, "CPUFreqSW_ANYGetPerf",
>                         "Failed to get CPU performance.");
> +               closedir(dir);
>                 return;
>         }
>         lowperf = (100 * lowperf) / top_speed;
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>>



More information about the fwts-devel mailing list