diff options
| author | Robertus Diawan Chris <robertusdchris@gmail.com> | 2026-06-24 11:47:42 +0700 |
|---|---|---|
| committer | Nicolas Schier <nsc@kernel.org> | 2026-08-05 14:51:58 +0200 |
| commit | 9a5b76027ed91680e10f90111d9cba300f96d1ab (patch) | |
| tree | 383529c1c6e600fb32055f68f86b5b0fe311911a /tools/perf/scripts/python | |
| parent | b7408f7cb264eb8d8b93c6cd84bd80cfd5865205 (diff) | |
modpost: prevent leak when early return no suffix .o in read_symbols()
The allocation for elf info symsearch and hdr from parse_elf() haven't
been released when return because of modname didn't have suffix ".o".
And it seems like the suffix ".o" check did not depends on parse_elf()
to succeed first. So, move the suffix ".o" check before checking
parse_elf() result to prevent resource leak when the modname didn't have
suffix ".o" and return early.
This is reported by Coverity Scan as "Resource leak".
Fixes: 8c9ce89c5b63 ("modpost: simplify mod->name allocation")
Signed-off-by: Robertus Diawan Chris <robertusdchris@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260624044742.144852-1-robertusdchris@gmail.com
Signed-off-by: Nicolas Schier <nsc@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
