net/mlx5: fix entry in shared Rx queues list
authorMichael Baum <michaelba@nvidia.com>
Mon, 14 Feb 2022 09:00:09 +0000 (11:00 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 23 Feb 2022 14:57:35 +0000 (15:57 +0100)
commit0ad12a8090d4f34b0308cdbb4cd34750f841d7f9
treeca7fdcd926db2f836d85c1ab541f1f156ae05232
parent9b57df5575de8f8e3615f6e5efce4ef664f288d2
net/mlx5: fix entry in shared Rx queues list

The mlx5_rxq_new function creates control structure and if it from
shared group, it is inserted into the shared RXQs list.

After that, there are some validations which in case they fail, RxQ
control object is released.
In these cases, invalid pointer to the object still in the list, and
access it may cause a crash.

Move the list insertion to the end of the function where the RxQ control
object is surely valid.

Fixes: 09c2555303be ("net/mlx5: support shared Rx queue")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5_rxq.c