mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
mlxsw: spectrum_router: Compare only trees which are in use during tree get
Only trees which are in use should be compared to requested prefix usage.
Fixes: 53342023ee ("mlxsw: spectrum_router: Implement LPM trees management")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2083d36790
commit
8b99becdc8
1 changed files with 2 additions and 1 deletions
|
|
@ -345,7 +345,8 @@ mlxsw_sp_lpm_tree_get(struct mlxsw_sp *mlxsw_sp,
|
|||
|
||||
for (i = 0; i < MLXSW_SP_LPM_TREE_COUNT; i++) {
|
||||
lpm_tree = &mlxsw_sp->router.lpm_trees[i];
|
||||
if (lpm_tree->proto == proto &&
|
||||
if (lpm_tree->ref_count != 0 &&
|
||||
lpm_tree->proto == proto &&
|
||||
mlxsw_sp_prefix_usage_eq(&lpm_tree->prefix_usage,
|
||||
prefix_usage))
|
||||
goto inc_ref_count;
|
||||
|
|
|
|||
Loading…
Reference in a new issue