From e03520316258add3a925f7a370a390b2245fa836 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Wed, 11 Jan 2023 11:13:40 +0100 Subject: [PATCH] Fix memory leak on failed tap creation per upstream 37b5cccb; Also, sync the RX/TX queues to be the same as upstream linux-cp --- lcpng_interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lcpng_interface.c b/lcpng_interface.c index 0fce5ec..412058f 100644 --- a/lcpng_interface.c +++ b/lcpng_interface.c @@ -951,13 +951,16 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, else { tap_create_if_args_t args = { - .num_rx_queues = 1, + .num_rx_queues = clib_max (1, vlib_num_workers ()), + .num_tx_queues = 1, .id = hw->hw_if_index, .sw_if_index = ~0, .rx_ring_sz = 256, .tx_ring_sz = 256, .host_if_name = host_if_name, .host_namespace = 0, + .rv = 0, + .error = NULL, }; ethernet_interface_t *ei; u32 host_sw_mtu_size; @@ -996,6 +999,7 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, { LCP_ITF_PAIR_ERR ("pair_create: could not create tap, retval:%d", args.rv); + clib_error_free (args.error); return args.rv; }