* [PATCH] selftest/bpf : file resource leak
@ 2018-10-17 13:41 ` Peng Hao
0 siblings, 0 replies; 4+ messages in thread
From: penghao122 @ 2018-10-17 13:41 UTC (permalink / raw)
From: Peng Hao <peng.hao2 at zte.com.cn>
FILE pointer variable f is opened but never closed.
Signed-off-by: Peng Hao <peng.hao2 at zte.com.cn>
---
tools/testing/selftests/bpf/trace_helpers.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
index cabe2a3..a3d1dac 100644
--- a/tools/testing/selftests/bpf/trace_helpers.c
+++ b/tools/testing/selftests/bpf/trace_helpers.c
@@ -41,6 +41,7 @@ int load_kallsyms(void)
syms[i].name = strdup(func);
i++;
}
+ fclose(f);
sym_cnt = i;
qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp);
return 0;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] selftest/bpf : file resource leak
@ 2018-10-17 13:41 ` Peng Hao
0 siblings, 0 replies; 4+ messages in thread
From: Peng Hao @ 2018-10-17 13:41 UTC (permalink / raw)
From: Peng Hao <peng.hao2@zte.com.cn>
FILE pointer variable f is opened but never closed.
Signed-off-by: Peng Hao <peng.hao2 at zte.com.cn>
---
tools/testing/selftests/bpf/trace_helpers.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
index cabe2a3..a3d1dac 100644
--- a/tools/testing/selftests/bpf/trace_helpers.c
+++ b/tools/testing/selftests/bpf/trace_helpers.c
@@ -41,6 +41,7 @@ int load_kallsyms(void)
syms[i].name = strdup(func);
i++;
}
+ fclose(f);
sym_cnt = i;
qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp);
return 0;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] selftest/bpf : file resource leak
@ 2018-10-18 4:51 ` Alexei Starovoitov
0 siblings, 0 replies; 4+ messages in thread
From: alexei.starovoitov @ 2018-10-18 4:51 UTC (permalink / raw)
On Wed, Oct 17, 2018 at 09:41:25AM -0400, Peng Hao wrote:
>
> From: Peng Hao <peng.hao2 at zte.com.cn>
>
> FILE pointer variable f is opened but never closed.
>
> Signed-off-by: Peng Hao <peng.hao2 at zte.com.cn>
> ---
> tools/testing/selftests/bpf/trace_helpers.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
> index cabe2a3..a3d1dac 100644
> --- a/tools/testing/selftests/bpf/trace_helpers.c
> +++ b/tools/testing/selftests/bpf/trace_helpers.c
> @@ -41,6 +41,7 @@ int load_kallsyms(void)
> syms[i].name = strdup(func);
> i++;
> }
> + fclose(f);
looks good.
please resubmit cc-ing netdev, so it gets into patchwork and we can apply it properly.
Please change subj to [PATCH bpf-next] and add a Fixes tag.
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] selftest/bpf : file resource leak
@ 2018-10-18 4:51 ` Alexei Starovoitov
0 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2018-10-18 4:51 UTC (permalink / raw)
On Wed, Oct 17, 2018@09:41:25AM -0400, Peng Hao wrote:
>
> From: Peng Hao <peng.hao2 at zte.com.cn>
>
> FILE pointer variable f is opened but never closed.
>
> Signed-off-by: Peng Hao <peng.hao2 at zte.com.cn>
> ---
> tools/testing/selftests/bpf/trace_helpers.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
> index cabe2a3..a3d1dac 100644
> --- a/tools/testing/selftests/bpf/trace_helpers.c
> +++ b/tools/testing/selftests/bpf/trace_helpers.c
> @@ -41,6 +41,7 @@ int load_kallsyms(void)
> syms[i].name = strdup(func);
> i++;
> }
> + fclose(f);
looks good.
please resubmit cc-ing netdev, so it gets into patchwork and we can apply it properly.
Please change subj to [PATCH bpf-next] and add a Fixes tag.
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-18 4:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 13:41 [PATCH] selftest/bpf : file resource leak penghao122
2018-10-17 13:41 ` Peng Hao
2018-10-18 4:51 ` alexei.starovoitov
2018-10-18 4:51 ` Alexei Starovoitov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.