Skip to content
  • Maria Pasechnik's avatar
    net/mlx5e: Fix NULL pointer derefernce in set channels error flow · fb35c534
    Maria Pasechnik authored
    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: bbeb53b8
    
     ("net/mlx5e: Move RSS params to a dedicated struct")
    Signed-off-by: default avatarMaria Pasechnik <mariap@mellanox.com>
    Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
    Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    fb35c534