[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZdCLuFZu_94_HTz5@lore-desk>
Date: Sat, 17 Feb 2024 11:34:32 +0100
From: Lorenzo Bianconi <lorenzo.bianconi@...hat.com>
To: Julian Wiedmann <jwiedmann.dev@...il.com>
Cc: Lorenzo Bianconi <lorenzo@...nel.org>, netdev@...r.kernel.org,
kuba@...nel.org, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, bpf@...r.kernel.org, toke@...hat.com,
willemdebruijn.kernel@...il.com, jasowang@...hat.com,
sdf@...gle.com, hawk@...nel.org, ilias.apalodimas@...aro.org,
linyunsheng@...wei.com
Subject: Re: [PATCH v9 net-next 3/4] xdp: add multi-buff support for xdp
running in generic mode
[...]
> > + nskb = napi_build_skb(data, truesize);
> > + if (!nskb) {
> > + page_pool_free_va(pool, data, true);
> > + return -ENOMEM;
> > + }
> > +
> > + skb_reserve(nskb, headroom);
> > + skb_copy_header(nskb, skb);
> > + skb_mark_for_recycle(nskb);
> > +
> > + err = skb_copy_bits(skb, 0, nskb->data, size);
> > + if (err) {
> > + consume_skb(nskb);
> > + return err;
> > + }
> > + skb_put(nskb, size);
> > +
> > + head_off = skb_headroom(nskb) - skb_headroom(skb);
> > + skb_headers_offset_update(nskb, head_off);
> > +
> > + off = size;
> > + len = skb->len - off;
> > + for (i = 0; i < MAX_SKB_FRAGS && off < skb->len; i++) {
> > + struct page *page;
> > + u32 page_off;
> > +
> > + size = min_t(u32, len, PAGE_SIZE);
> > + truesize = size;
> > +
> > + page = page_pool_dev_alloc(pool, &page_off, &truesize);
> > + if (!data) {
ack, right. I will post a fix, thx for reporting the issue.
Regards,
Lorenzo
> > + consume_skb(nskb);
> > + return -ENOMEM;
> > + }
> > +
>
> This should check for !page instead, no?
>
> (picked up as CID 1583654 by the coverity scan for linux-next)
>
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists