On Fri, 3 Jul 2026 at 16:50, Radu Nicolau <[email protected]> wrote:
>
> The Rx/Tx functions allocate cookies as needed, no need to
> allocate and free from heap.
>
> Fixes: 6f0175ff53e0 ("crypto/virtio: support basic PMD ops")
> Cc: [email protected]
>
> Signed-off-by: Radu Nicolau <[email protected]>
LGTM, except one nit below.
[snip]
>
> -cookie_alloc_err:
> - rte_mempool_free(vq->mpool);
> - if (i != 0) {
> - for (j = 0; j < i; j++)
> - rte_free(vq->vq_descx[j].cookie);
> - }
> mpool_create_err:
> + rte_mempool_free(vq->mpool);
vq->mpool == NULL if reaching this label.
Calling rte_mempool_free() with NULL is harmless/noop.
Still, there is no need (and I find it confusing) to add
rte_mempool_free under the mpool_create_err label.
> rte_free(vq);
> return -ENOMEM;
> }
> --
> 2.52.0
>
--
David Marchand