net/mlx4: fix drop queue error handling
authorMichael Baum <michaelba@mellanox.com>
Wed, 6 May 2020 16:27:54 +0000 (16:27 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 May 2020 20:27:39 +0000 (22:27 +0200)
commit6f155c0b9de5a58b5653d3e81c553564984f3c36
treec0636b6300ef31ebef9941a79ad00482dfb21125
parentc8f0abe7f89d61a347ba9e2d3bf337c89c0fb16f
net/mlx4: fix drop queue error handling

The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
if needed allocates by rte_malloc.

If the allocation is failed the function goes to label “error”, and
there does dereference to a null pointer.

Skip resources cleaning when the memory allocation is failed.

Coverity issue: 146206
Coverity issue: 146146
Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx4/mlx4_flow.c