Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1353037

Re: [tip:perf/core] perf tools: Fix locale handling in pmu parsing

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [tip:perf/core] perf tools: Fix locale handling in pmu parsing
Date 2016-03-08 14:30 +0100
Message-ID <rapS2-1q3-17@gated-at.bofh.it> (permalink)
References <r8yd4-550-3@gated-at.bofh.it> <r9fBo-3k0-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* tip-bot for Jiri Olsa <tipbot@zytor.com> wrote:

> @@ -135,6 +146,8 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *
>  	/* restore locale */
>  	setlocale(LC_NUMERIC, lc);
>  
> +	free((char *) lc);
> +

Btw., minor side note: why does 'lc' have to be case to 'char *'?

In the kernel kfree() takes 'const void *':

  include/linux/slab.h:void kfree(const void *);

which will accept all pointer types. That avoids unnecessary and fragile type 
casts.

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[tip:perf/core] perf tools: Fix locale handling in pmu parsing tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-03-05 09:20 +0100
  Re: [tip:perf/core] perf tools: Fix locale handling in pmu parsing Ingo Molnar <mingo@kernel.org> - 2016-03-08 14:30 +0100
    [PATCH][perf/core] perf tools: Omit unnecessary cast in  perf_pmu__parse_scale Jiri Olsa <jolsa@redhat.com> - 2016-03-08 19:50 +0100
      Re: [PATCH][perf/core] perf tools: Omit unnecessary cast in  perf_pmu__parse_scale Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-03-09 14:50 +0100
      [tip:perf/core] perf tools: Omit unnecessary cast in  perf_pmu__parse_scale tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-03-11 09:50 +0100

csiph-web