Thread (5 messages) 5 messages, 5 authors, 2020-07-29

Re: [PATCH bpf-next] selftests/bpf: don't destroy failed link

From: Andrii Nakryiko <hidden>
Date: 2020-07-29 06:16:40
Also in: bpf

On Tue, Jul 28, 2020 at 10:47 PM Song Liu [off-list ref] wrote:
On Tue, Jul 28, 2020 at 9:54 PM Andrii Nakryiko [off-list ref] wrote:
quoted
Check that link is NULL or proper pointer before invoking bpf_link__destroy().
Not doing this causes crash in test_progs, when cg_storage_multi selftest
fails.

Cc: YiFei Zhu <redacted>
Fixes: 3573f384014f ("selftests/bpf: Test CGROUP_STORAGE behavior on shared egress + ingress")
Signed-off-by: Andrii Nakryiko <redacted>
Acked-by: Song Liu <redacted>

btw: maybe we can move the IS_ERR() check to bpf_link__destroy()?
Yeah, given how common this mistake seems to be, that wouldn't be a bad idea.
quoted
---
 .../bpf/prog_tests/cg_storage_multi.c         | 42 ++++++++++++-------
 1 file changed, 28 insertions(+), 14 deletions(-)
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help