numam-dpdk/drivers
Michael Baum ebed623f62 net/mlx5: fix hairpin Rx queue creation error path
The mlx5_rxq_obj_hairpin_new function defines a pointer named tmpl and
allocates memory for it using the rte_zmalloc_socket function.
Later, this function allocates memory to a variable inside tmpl using
the mlx5_devx_cmd_create_rq function.

In both cases, if the allocation fails, the code jumps to the error
label and frees allocated resources. However, in the first jump there
are still no resources to free and the jump only for the line return
NULL is unnecessary. Even worse, when it jumps to error label with
invalid tmpl it actually does dereference to a null pointer.
In contrast, the second jump needs to free the tmpl variable but the
function instead of freeing, tries to free the variable that it just
failed to allocate.
In addition, for another error, the function returns NULL without
freeing the tmpl variable before, causing a memory leak.

Delete the error label and replace each jump with local return NULL and
free tmpl variable if needed.

Fixes: e79c9be915 ("net/mlx5: support Rx hairpin queues")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:23 +02:00
..
baseband baseband/fpga_5gnr_fec: support interrupt 2020-04-19 22:34:26 +02:00
bus bus/fslmc: drop inline from non-static functions 2020-05-20 15:15:48 +02:00
common mempool/octeontx2: add devargs to lock context in cache 2020-05-19 18:28:58 +02:00
compress fix various typos found by Lintian 2020-04-25 19:53:47 +02:00
crypto bus/fslmc: add accessor for MCP 2020-05-19 15:49:53 +02:00
event mempool/octeontx2: add devargs to lock context in cache 2020-05-19 18:28:58 +02:00
mempool mempool/octeontx2: add devargs to lock context in cache 2020-05-19 18:28:58 +02:00
net net/mlx5: fix hairpin Rx queue creation error path 2020-06-02 16:06:23 +02:00
raw bus/fslmc: add accessor for MCP 2020-05-19 15:49:53 +02:00
vdpa vdpa/mlx5: fix PCI address comparison 2020-05-05 15:54:26 +02:00
Makefile drivers: add crypto as dependency for event drivers 2020-03-05 14:22:11 +01:00
meson.build build: skip config of explicitly disabled drivers 2020-05-19 16:52:22 +02:00