net/netvsc: fix Tx queue leak in error path
authorYunjian Wang <wangyunjian@huawei.com>
Wed, 7 Oct 2020 02:06:25 +0000 (10:06 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:18:47 +0000 (19:18 +0200)
commitf3013acfc17b8920b97223421976f3b3bb32489a
treec439b073a0d13babca23e4efbe08c1f22f856e25
parentc6299a086711b0578fcebe6a2ee99f3cba6faa54
net/netvsc: fix Tx queue leak in error path

In hn_dev_tx_queue_setup() allocated memory for txq, we don't free it
when error happens and it will lead to memory leak.

We can check for tx_free_thresh at the beginning of the function to
fix it, before calling txq = rte_zmalloc_socket().

Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Long Li <longli@microsoft.com>
drivers/net/netvsc/hn_rxtx.c