Re: [v5 PATCH 11/14] xfrm: ipcomp: Use crypto_acomp interface

Herbert Xu
2025-03-20T09:34:29Z

On Sat, Mar 15, 2025 at 06:30:43PM +0800, Herbert Xu wrote:
>
> + sg_init_table(dsg, dnfrags);
> + total = 0;
> + for (i = 0; i < dnfrags && total < dlen; i++) {
> + struct page *page;
> +
> + page = alloc_page(GFP_ATOMIC);
> + if (!page)
> + break;
> + sg_set_page(dsg + i, page, PAGE_SIZE, 0);
> + total += PAGE_SIZE;
> + }
> + if (!i)
> + return ERR_PTR(-ENOMEM);
> + sg_mark_end(dsg + i - 1);

This is missing a

dlen = min(dlen, total);

> +
> + acomp_request_set_params(req, sg, dsg, plen, dlen);

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt