mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
mlxsw: spectrum_router: Fix rif counter freeing routine
During rif counter freeing the counter index can be invalid. Add check
of validity before freeing the counter.
Fixes: e0c0afd8aa
("mlxsw: spectrum: Support for counters on router interfaces")
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6dd4aba36f
commit
6b1206bbbc
1 changed files with 3 additions and 0 deletions
|
@ -206,6 +206,9 @@ void mlxsw_sp_rif_counter_free(struct mlxsw_sp *mlxsw_sp,
|
|||
{
|
||||
unsigned int *p_counter_index;
|
||||
|
||||
if (!mlxsw_sp_rif_counter_valid_get(rif, dir))
|
||||
return;
|
||||
|
||||
p_counter_index = mlxsw_sp_rif_p_counter_get(rif, dir);
|
||||
if (WARN_ON(!p_counter_index))
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue