mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
net/mlx5e: Fix free peer_flow when refcount is 0
commit eb252c3a24fc5856fa62140c2f8269ddce6ce4e5 upstream.
It could be neigh update flow took a refcount on peer flow so
sometimes we cannot release peer flow even if parent flow is
being freed now.
Fixes: 5a7e5bcb66 ("net/mlx5e: Extend tc flow struct with reference counter")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9bc7663b71
commit
142cb2bd61
1 changed files with 5 additions and 2 deletions
|
|
@ -1615,8 +1615,11 @@ static void __mlx5e_tc_del_fdb_peer_flow(struct mlx5e_tc_flow *flow)
|
|||
|
||||
flow_flag_clear(flow, DUP);
|
||||
|
||||
mlx5e_tc_del_fdb_flow(flow->peer_flow->priv, flow->peer_flow);
|
||||
kfree(flow->peer_flow);
|
||||
if (refcount_dec_and_test(&flow->peer_flow->refcnt)) {
|
||||
mlx5e_tc_del_fdb_flow(flow->peer_flow->priv, flow->peer_flow);
|
||||
kfree(flow->peer_flow);
|
||||
}
|
||||
|
||||
flow->peer_flow = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue