linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Masanari Iida <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	tglx@linutronix.de, standby24x7@gmail.com, jolsa@redhat.com
Subject: [tip:perf/urgent] perf tests x86: Fix memory leak in sample_ustack()
Date: Wed, 23 Apr 2014 06:13:24 -0700	[thread overview]
Message-ID: <tip-763d7f5f2718f085bab5a9e63308349728f3ad12@git.kernel.org> (raw)
In-Reply-To: <1398091024-7901-1-git-send-email-standby24x7@gmail.com>

Commit-ID:  763d7f5f2718f085bab5a9e63308349728f3ad12
Gitweb:     http://git.kernel.org/tip/763d7f5f2718f085bab5a9e63308349728f3ad12
Author:     Masanari Iida <standby24x7@gmail.com>
AuthorDate: Sun, 20 Apr 2014 00:16:41 +0900
Committer:  Jiri Olsa <jolsa@redhat.com>
CommitDate: Wed, 23 Apr 2014 13:19:01 +0200

perf tests x86: Fix memory leak in sample_ustack()

The buf is not freed, when kernel failed to get stack map
and return.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Link: http://lkml.kernel.org/r/1398091024-7901-1-git-send-email-standby24x7@gmail.com
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 tools/perf/arch/x86/tests/dwarf-unwind.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c
index b602ad9..b8c0102 100644
--- a/tools/perf/arch/x86/tests/dwarf-unwind.c
+++ b/tools/perf/arch/x86/tests/dwarf-unwind.c
@@ -26,6 +26,7 @@ static int sample_ustack(struct perf_sample *sample,
 	map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
 	if (!map) {
 		pr_debug("failed to get stack map\n");
+		free(buf);
 		return -1;
 	}
 

      reply	other threads:[~2014-04-23 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-19 15:16 [PATCH] perf test x86: Fit memory leak in sample_ustack() Masanari Iida
2014-04-19 22:19 ` Jiri Olsa
2014-04-19 22:33   ` Jiri Olsa
2014-04-21 14:37 ` [PATCH/v2] " Masanari Iida
2014-04-23 13:13   ` tip-bot for Masanari Iida [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-763d7f5f2718f085bab5a9e63308349728f3ad12@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=standby24x7@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).