From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbcDRXHd (ORCPT ); Mon, 18 Apr 2016 19:07:33 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:42652 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbcDRXHc (ORCPT ); Mon, 18 Apr 2016 19:07:32 -0400 From: Colin King To: Peter Zijlstra , Ingo Molnar , rnaldo Carvalho de Melo , Alexander Shishkin , Adrian Hunter , Stephane Eranian Cc: linux-kernel@vger.kernel.org Subject: [PATCH] perf jit: memset variable st using the correct size Date: Tue, 19 Apr 2016 00:07:18 +0100 Message-Id: <1461020838-9260-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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