[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a08edadc-7ab3-d23a-a8be-0897e2a11c08@gmail.com>
Date: Fri, 22 May 2020 11:45:20 -0600
From: David Ahern <dsahern@...il.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>,
David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, brouer@...hat.com,
daniel@...earbox.net, john.fastabend@...il.com, ast@...nel.org,
kafai@...com, songliubraving@...com, yhs@...com, andriin@...com
Subject: Re: [PATCH RFC bpf-next 2/4] bpf: Add support to attach bpf program
to a devmap
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.
Powered by blists - more mailing lists