summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/device.py
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2022-06-08 22:23:52 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-06-19 10:41:43 -0300
commit94725994cfd768b9ee1bd06f15c252694b1e9b89 (patch)
tree32c9114c24945da99f6225d1209a1c16120f4304 /scripts/gdb/linux/device.py
parentec906102e5b7d3393cfe83e606b48cf0c1fcb122 (diff)
libperf evsel: Open shouldn't leak fd on failure
If perf_event_open() fails the fd is opened but it is only freed by closing (not by delete). Typically when an open fails you don't call close and so this results in a memory leak. To avoid this, add a close when open fails. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-By: Kajol Jain <kjain@linux.ibm.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rob Herring <robh@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20220609052355.1300162-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts/gdb/linux/device.py')
0 files changed, 0 insertions, 0 deletions