common/mlx5: fix freeing on flex parser creation failure
authorMichael Baum <michaelba@nvidia.com>
Wed, 11 Nov 2020 07:36:48 +0000 (07:36 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 14 Nov 2020 00:36:19 +0000 (01:36 +0100)
commitf84d733cef13d15ad178535c5cb931851192bab0
tree4786bd6fed376fd6f87cb49ddf5b2f281631b82f
parent2a87415cc9c3cf72f498e44f3f42d2b6ca07c7fd
common/mlx5: fix freeing on flex parser creation failure

The mlx5_devx_cmd_create_flex_parser function defines a local array
(with constant size) named in, and then allocates a pointer to
mlx5_devx_obj structure by the mlx5_malloc function.

If the allocation fails, the function releases the array in and returns
NULL. However, the array has been defined locally on the stack and the
mlx5_free function is not required to release it.

Remove the call to the mlx5_free function.

Fixes: 66914d19d135 ("common/mlx5: convert control path memory to unified malloc")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/common/mlx5/mlx5_devx_cmds.c