]> git.ipfire.org Git - thirdparty/linux.git/commit
net/mlx5e: Fix NULL pointer derefernce in set channels error flow
authorMaria Pasechnik <mariap@mellanox.com>
Sun, 3 Feb 2019 15:55:09 +0000 (17:55 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 13 Feb 2019 23:40:50 +0000 (15:40 -0800)
commitfb35c534b7881c0f7f94b01ddd95a9b17483252f
treec48c2c053e9222b8cd558d8c97eef27ae9aae8f2
parent2fdeee2549231b1f989f011bb18191f5660d3745
net/mlx5e: Fix NULL pointer derefernce in set channels error flow

New channels are applied to the priv channels only after they
are successfully opened. Then, the indirection table should be built
according to the new number of channels.
Currently, such build is preformed independently of whether the
channels opening is successful, and is not reverted on failure.

The bug is caused due to removal of rss params from channels struct
and moving it to priv struct. That change cause to independency between
channels and rss params.
This causes a crash on a later point, when accessing rqn of a non
existing channel.

This patch fixes it by moving the indirection table build right before
switching the priv channels to new channels struct, after the new set of
channels was successfully opened.

Fixes: bbeb53b8b2c9 ("net/mlx5e: Move RSS params to a dedicated struct")
Signed-off-by: Maria Pasechnik <mariap@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c