Patch "perf kwork: Fix incorrect and missing free atom in work_push_atom()" has been added to the 6.5-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 kwork: Fix incorrect and missing free atom in work_push_atom()

to the 6.5-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-kwork-fix-incorrect-and-missing-free-atom-in-wo.patch
and it can be found in the queue-6.5 subdirectory.

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



commit 6494550c12c1a93475d0f91e76be57db0678e8f1
Author: Yang Jihong <yangjihong1@xxxxxxxxxx>
Date:   Sat Aug 12 08:49:02 2023 +0000

    perf kwork: Fix incorrect and missing free atom in work_push_atom()
    
    [ Upstream commit d39710088d82ef100b33cdf4a9de3546fb0bb5df ]
    
    1. Atoms are managed in page mode and should be released using atom_free()
       instead of free().
    2. When the event does not match, the atom needs to free.
    
    Fixes: f98919ec4fccdacf ("perf kwork: Implement 'report' subcommand")
    Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
    Signed-off-by: Yang Jihong <yangjihong1@xxxxxxxxxx>
    Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
    Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
    Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
    Cc: Mark Rutland <mark.rutland@xxxxxxx>
    Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Ravi Bangoria <ravi.bangoria@xxxxxxx>
    Cc: Sandipan Das <sandipan.das@xxxxxxx>
    Cc: Yang Jihong <yangjihong1@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230812084917.169338-2-yangjihong1@xxxxxxxxxx
    Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c
index 14bf7a8429e76..73b5dc099a8ae 100644
--- a/tools/perf/builtin-kwork.c
+++ b/tools/perf/builtin-kwork.c
@@ -406,12 +406,14 @@ static int work_push_atom(struct perf_kwork *kwork,
 
 	work = work_findnew(&class->work_root, &key, &kwork->cmp_id);
 	if (work == NULL) {
-		free(atom);
+		atom_free(atom);
 		return -1;
 	}
 
-	if (!profile_event_match(kwork, work, sample))
+	if (!profile_event_match(kwork, work, sample)) {
+		atom_free(atom);
 		return 0;
+	}
 
 	if (dst_type < KWORK_TRACE_MAX) {
 		dst_atom = list_last_entry_or_null(&work->atom_list[dst_type],



[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