Patch "perf mem: Free the allocated sort string, fixing a leak" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf mem: Free the allocated sort string, fixing a leak

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-mem-free-the-allocated-sort-string-fixing-a-lea.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 66cfd075ecfc7242e7b0fce9cdc2baa11b631880
Author: Namhyung Kim <namhyung@xxxxxxxxxx>
Date:   Wed Jul 31 16:55:01 2024 -0700

    perf mem: Free the allocated sort string, fixing a leak
    
    [ Upstream commit 3da209bb1177462b6fe8e3021a5527a5a49a9336 ]
    
    The get_sort_order() returns either a new string (from strdup) or NULL
    but it never gets freed.
    
    Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
    Fixes: 2e7f545096f954a9 ("perf mem: Factor out a function to generate sort order")
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Athira Rajeev <atrajeev@xxxxxxxxxxxxxxxxxx>
    Cc: Ian Rogers <irogers@xxxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Stephane Eranian <eranian@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240731235505.710436-3-namhyung@xxxxxxxxxx
    [ Added Fixes tag ]
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 863fcd735daee..93413cfcd585a 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -372,6 +372,7 @@ static int report_events(int argc, const char **argv, struct perf_mem *mem)
 		rep_argv[i] = argv[j];
 
 	ret = cmd_report(i, rep_argv);
+	free(new_sort_order);
 	free(rep_argv);
 	return ret;
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux