[Resource Leak] Missing closing files in tools/bpf/bpf_asm.c

2 messages, 2 authors, 2022-01-05 · open the first message on its own page

[Resource Leak] Missing closing files in tools/bpf/bpf_asm.c

From: Ryan Cai <hidden>
Date: 2021-12-30 03:41:02

Dear Kernel maintainers,
              1. In tools/bpf/bpf_asm.c, the file opened at Line 40 may not closed within the function?
              Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/bpf/bpf_asm.c#L40-L49
 
              Should it be a bug? I can send patches for these.
 
Best,
Ryan

Re: [Resource Leak] Missing closing files in tools/bpf/bpf_asm.c

From: Andrii Nakryiko <hidden>
Date: 2022-01-05 23:51:07

On Wed, Dec 29, 2021 at 7:40 PM Ryan Cai [off-list ref] wrote:
Dear Kernel maintainers,
              1. In tools/bpf/bpf_asm.c, the file opened at Line 40 may not closed within the function?
              Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/tools/bpf/bpf_asm.c#L40-L49

              Should it be a bug? I can send patches for these.
file will be closed by the kernel on exit, but it would be better to
close it explicitly, so please feel free to send a fix
Best,
Ryan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help