public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: dso_load - move name malloc to when needed
@ 2013-01-14 16:50 David Ahern
  2013-01-14 17:38 ` devendra.aaru
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2013-01-14 16:50 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel, David Ahern

memory is currently leaked on some paths.
---
 tools/perf/util/symbol.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 61edfd0..e9c0c3a 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -775,10 +775,6 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	else
 		machine = NULL;
 
-	name = malloc(PATH_MAX);
-	if (!name)
-		return -1;
-
 	dso->adjust_symbols = 0;
 
 	if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
@@ -802,6 +798,10 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	if (machine)
 		root_dir = machine->root_dir;
 
+	name = malloc(PATH_MAX);
+	if (!name)
+		return -1;
+
 	/* Iterate over candidate debug images.
 	 * Keep track of "interesting" ones (those which have a symtab, dynsym,
 	 * and/or opd section) for processing.
-- 
1.7.10.1


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

* Re: [PATCH] perf: dso_load - move name malloc to when needed
  2013-01-14 16:50 [PATCH] perf: dso_load - move name malloc to when needed David Ahern
@ 2013-01-14 17:38 ` devendra.aaru
  2013-01-14 17:39   ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: devendra.aaru @ 2013-01-14 17:38 UTC (permalink / raw)
  To: David Ahern; +Cc: acme, linux-kernel

On Mon, Jan 14, 2013 at 11:50 AM, David Ahern <dsahern@gmail.com> wrote:
> memory is currently leaked on some paths.

you are missing a signoff.

> ---
>  tools/perf/util/symbol.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 61edfd0..e9c0c3a 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -775,10 +775,6 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
>         else
>                 machine = NULL;
>
> -       name = malloc(PATH_MAX);
> -       if (!name)
> -               return -1;
> -
>         dso->adjust_symbols = 0;
>
>         if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
> @@ -802,6 +798,10 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
>         if (machine)
>                 root_dir = machine->root_dir;
>
> +       name = malloc(PATH_MAX);
> +       if (!name)
> +               return -1;
> +
>         /* Iterate over candidate debug images.
>          * Keep track of "interesting" ones (those which have a symtab, dynsym,
>          * and/or opd section) for processing.
> --
> 1.7.10.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH] perf: dso_load - move name malloc to when needed
  2013-01-14 17:38 ` devendra.aaru
@ 2013-01-14 17:39   ` David Ahern
  0 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2013-01-14 17:39 UTC (permalink / raw)
  To: devendra.aaru; +Cc: acme, linux-kernel

On 1/14/13 10:38 AM, devendra.aaru wrote:
> On Mon, Jan 14, 2013 at 11:50 AM, David Ahern <dsahern@gmail.com> wrote:
>> memory is currently leaked on some paths.
>
> you are missing a signoff.

grr.... did that on all 3. I'll resend.

David


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

* [PATCH] perf: dso_load - move name malloc to when needed
@ 2013-01-14 17:46 David Ahern
  2013-01-25 11:47 ` [tip:perf/core] perf symbols: Move name malloc to when needed in dso__load tip-bot for David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2013-01-14 17:46 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern

memory is currently leaked on some paths.

Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/perf/util/symbol.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 61edfd0..e9c0c3a 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -775,10 +775,6 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	else
 		machine = NULL;
 
-	name = malloc(PATH_MAX);
-	if (!name)
-		return -1;
-
 	dso->adjust_symbols = 0;
 
 	if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
@@ -802,6 +798,10 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	if (machine)
 		root_dir = machine->root_dir;
 
+	name = malloc(PATH_MAX);
+	if (!name)
+		return -1;
+
 	/* Iterate over candidate debug images.
 	 * Keep track of "interesting" ones (those which have a symtab, dynsym,
 	 * and/or opd section) for processing.
-- 
1.7.10.1


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

* [tip:perf/core] perf symbols: Move name malloc to when needed in dso__load
  2013-01-14 17:46 [PATCH] perf: dso_load - move name malloc to when needed David Ahern
@ 2013-01-25 11:47 ` tip-bot for David Ahern
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for David Ahern @ 2013-01-25 11:47 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: acme, linux-kernel, hpa, mingo, dsahern, tglx

Commit-ID:  164c800e42657e586f6fd446b3d8d41cf1f815f1
Gitweb:     http://git.kernel.org/tip/164c800e42657e586f6fd446b3d8d41cf1f815f1
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Mon, 14 Jan 2013 10:46:47 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 24 Jan 2013 16:40:30 -0300

perf symbols: Move name malloc to when needed in dso__load

Memory is currently leaked on some paths.

Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1358185607-90799-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 2960284..daf9554 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -768,10 +768,6 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	else
 		machine = NULL;
 
-	name = malloc(PATH_MAX);
-	if (!name)
-		return -1;
-
 	dso->adjust_symbols = 0;
 
 	if (strncmp(dso->name, "/tmp/perf-", 10) == 0) {
@@ -795,6 +791,10 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
 	if (machine)
 		root_dir = machine->root_dir;
 
+	name = malloc(PATH_MAX);
+	if (!name)
+		return -1;
+
 	/* Iterate over candidate debug images.
 	 * Keep track of "interesting" ones (those which have a symtab, dynsym,
 	 * and/or opd section) for processing.

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

end of thread, other threads:[~2013-01-25 11:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 17:46 [PATCH] perf: dso_load - move name malloc to when needed David Ahern
2013-01-25 11:47 ` [tip:perf/core] perf symbols: Move name malloc to when needed in dso__load tip-bot for David Ahern
  -- strict thread matches above, loose matches on Subject: below --
2013-01-14 16:50 [PATCH] perf: dso_load - move name malloc to when needed David Ahern
2013-01-14 17:38 ` devendra.aaru
2013-01-14 17:39   ` David Ahern

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