public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf jit: memset variable st using the correct size
@ 2016-04-18 23:07 Colin King
  2016-04-19 13:47 ` rnaldo Carvalho de Melo
  2016-04-23 13:04 ` [tip:perf/core] perf jit: memset() variable 'st' " tip-bot for Colin Ian King
  0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2016-04-18 23:07 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, rnaldo Carvalho de Melo,
	Alexander Shishkin, Adrian Hunter, Stephane Eranian
  Cc: linux-kernel

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.

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-23 13:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 23:07 [PATCH] perf jit: memset variable st using the correct size Colin King
2016-04-19 13:47 ` rnaldo Carvalho de Melo
2016-04-19 13:52   ` rnaldo Carvalho de Melo
2016-04-23 13:04 ` [tip:perf/core] perf jit: memset() variable 'st' " tip-bot for Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox