Skip to contentSkip to conversation

Missing closing files in samples/bpf/hbm.c

Resource Leak Ryan Cai 2 participants 2 messages Dec 30, 2021 – Jan 5, 2022

Subsystems (3)
lore
Share & tools
lore

Ryan Cai

author
#0 lore raw

Dear Kernel maintainers,

1. In run_bpf_prog, the file opened at Line 308 may not closed when going to Line 310.
Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L302-L310

2. In read_trace_pipe2, the file opened at Line 91 may not closed in the function.
Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L91-L109

Should it be a bug? I can send a patch for these.

Best,
Ryan

#1 lore raw
Quoted 11 lines · Ryan Cai

Dear Kernel maintainers,

1. In run_bpf_prog, the file opened at Line 308 may not closed when going to Line 310.
Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L302-L310

2. In read_trace_pipe2, the file opened at Line 91 may not closed in the function.
Location: https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/samples/bpf/hbm.c#L91-L109

Should it be a bug? I can send a patch for these.

seems so, please send patches

Quoted 4 lines

Best,
Ryan