projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
751b178
)
perf python: Reference Py_None before returning it
author
Petr Machata
<
[email protected]
>
Wed, 21 Mar 2018 23:57:32 +0000
(
00:57
+0100)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Fri, 23 Mar 2018 19:45:20 +0000
(16:45 -0300)
Python None objects are handled just like all the other objects with
respect to their reference counting. Before returning Py_None, its
reference count thus needs to be bumped.
Signed-off-by: Petr Machata <
[email protected]
>
Acked-by: Jiri Olsa <
[email protected]
>
Cc: Alexander Shishkin <
[email protected]
>
Cc: Namhyung Kim <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Petr Machata <
[email protected]
>
Link:
http://lkml.kernel.org/r/b1e565ecccf68064d8d54f37db5d028dda8fa522.1521675563.git.petrm@mellanox.com
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/python.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/python.c
b/tools/perf/util/python.c
index b956868fd44503e1e1607f99f2e11c87c907e207..863b61478edd6d21533b925dde01abef35354a80 100644
(file)
--- a/
tools/perf/util/python.c
+++ b/
tools/perf/util/python.c
@@
-1004,8
+1004,10
@@
static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist,
return PyErr_NoMemory();
evsel = perf_evlist__event2evsel(evlist, event);
- if (!evsel)
+ if (!evsel) {
+ Py_INCREF(Py_None);
return Py_None;
+ }
pevent->evsel = evsel;