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


Groups > linux.kernel > #1382527

Re: [PATCH] perf jit: memset variable st using the correct size

From rnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] perf jit: memset variable st using the correct size
Date 2016-04-19 15:50 +0200
Message-ID <rpEcp-7GG-1@gated-at.bofh.it> (permalink)
References <rpqsP-5sV-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Tue, Apr 19, 2016 at 12:07:18AM +0100, Colin King escreveu:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The current code is memsetting the struct stat variable st with
> the size of stat (which turns out to be 1 byte) rather than the
> size of variable sz.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  tools/perf/util/jitdump.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
> index 52fcef3..86afe96 100644
> --- a/tools/perf/util/jitdump.c
> +++ b/tools/perf/util/jitdump.c
> @@ -412,7 +412,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
>  		return -1;
>  	}
>  	if (stat(filename, &st))
> -		memset(&st, 0, sizeof(stat));
> +		memset(&st, 0, sizeof(st));
>  
>  	event->mmap2.header.type = PERF_RECORD_MMAP2;
>  	event->mmap2.header.misc = PERF_RECORD_MISC_USER;
> @@ -500,7 +500,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
>  	size++; /* for \0 */
>  
>  	if (stat(filename, &st))
> -		memset(&st, 0, sizeof(stat));
> +		memset(&st, 0, sizeof(st));
>  
>  	size = PERF_ALIGN(size, sizeof(u64));
>  
> -- 
> 2.7.4

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


Thread

[PATCH] perf jit: memset variable st using the correct size Colin King <colin.king@canonical.com> - 2016-04-19 01:10 +0200
  Re: [PATCH] perf jit: memset variable st using the correct size rnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-19 15:50 +0200
    Re: [PATCH] perf jit: memset variable st using the correct size rnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-19 16:00 +0200
  [tip:perf/core] perf jit: memset() variable 'st' using the correct  size tip-bot for Colin Ian King <tipbot@zytor.com> - 2016-04-23 15:10 +0200

csiph-web