# Re: \[PATCH 10/14\] bpf/tests: Add branch conversion JIT test

- From: Johan Almbladh \<johan.almbladh@anyfinetworks.com\>
- Date: 2021-07-29 12:46:07 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/07/7775025
- Thread: https://ratatoskr.run/netdev/2021/07/7774981/t.md

```text
On Thu, Jul 29, 2021 at 1:59 AM Yonghong Song [ref] wrote:
> > +static int bpf_fill_long_jmp(struct bpf_test *self)
> > +{
> > +     unsigned int len = BPF_MAXINSNS;
> > +     struct bpf_insn *insn;
> > +     int i;
> > +
> > +     insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL);
> > +     if (!insn)
> > +             return -ENOMEM;
>
> When insn will be freed?

It is freed by the existing test runner code. If the fill_helper
member is set, the function destroy_bpf_tests frees the insn pointer
in that test case. This is the same as with other tests that use the
fill_helper facility.
```
