On 5/22/20 10:02 AM, Toke Høiland-Jørgensen wrote:
>> @@ -563,12 +619,23 @@ static struct bpf_dtab_netdev
>> *__dev_map_alloc_node(struct net *net,
>> if (!dev->dev)
>> goto err_out;
>>
>> + if (prog_id) {
>> + prog = bpf_prog_by_id(prog_id);
>> + if (IS_ERR(prog) || prog->type != BPF_PROG_TYPE_XDP ||
>> + prog->expected_attach_type != BPF_XDP_DEVMAP)
>
> If the second or third condition fails here you never bpf_prog_put() the
> prog ref.
> good catch. Thanks, will fix.
