Commit 83428f2f authored by Petr Machata's avatar Petr Machata Committed by Arnaldo Carvalho de Melo

perf python: Reference Py_None before returning it

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: default avatarPetr Machata <>
Acked-by: default avatarJiri Olsa <>
Cc: Alexander Shishkin <>
Cc: Namhyung Kim <>
Cc: Peter Zijlstra <>
Cc: Petr Machata <>
Link: default avatarArnaldo Carvalho de Melo <>
parent 751b1783
......@@ -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) {
return Py_None;
pevent->evsel = evsel;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment