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

- From: Yonghong Song \<hidden\>
- Date: 2021-07-29 15:47:16 
- List: netdev
- Page: https://ratatoskr.run/netdev/2021/07/7775029
- Thread: https://ratatoskr.run/netdev/2021/07/7774981/t.md

```text


On 7/29/21 5:45 AM, Johan Almbladh wrote:
> 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.

Sounds good. Thanks for explanation.
```
