On Thu, May 08, 2025 at 11:44:34AM +0300, Cosmin Ratiu wrote: > netdev_bind_rx takes ownership of the queue array passed as parameter > and frees it, so a queue array buffer cannot be reused across multiple > netdev_bind_rx calls. > > This commit fixes that by always passing in a newly created queue array > to all netdev_bind_rx calls in ncdevmem. > > Fixes: 85585b4bc8d8 ("selftests: add ncdevmem, netcat for devmem TCP") > Signed-off-by: Cosmin Ratiu <cra...@nvidia.com> > --- > .../selftests/drivers/net/hw/ncdevmem.c | 55 ++++++++----------- > 1 file changed, 22 insertions(+), 33 deletions(-) > > diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c > b/tools/testing/selftests/drivers/net/hw/ncdevmem.c > index 2bf14ac2b8c6..9d48004ff1a1 100644 > --- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c > +++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c > @@ -431,6 +431,22 @@ static int parse_address(const char *str, int port, > struct sockaddr_in6 *sin6)
> + queues = calloc(num_queues, sizeof(*queues)); > - queues = malloc(sizeof(*queues) * num_queues); > + if (!bind_rx_queue(ifindex, mem->fd, > + calloc(num_queues, sizeof(struct netdev_queue_id)), Nit: it looks like in the original we didn't care about malloc potentially failing. Do we care about checking for that now with this cleanup? Otherwise: Reviewed-by: Joe Damato <jdam...@fastly.com>