mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 03:45:20 +07:00
net/mlx5e: Fix possible memory leak
'encap_header' is malloced and should be freed before leaving from
the error handling cases, otherwise it will cause memory leak.
Fixes: 232c001398
("net/mlx5e: Add support to neighbour update flow")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
74ed053d1c
commit
27902f0806
@ -1404,8 +1404,8 @@ static int mlx5e_create_encap_header_ipv4(struct mlx5e_priv *priv,
|
||||
|
||||
if (!(nud_state & NUD_VALID)) {
|
||||
neigh_event_send(n, NULL);
|
||||
neigh_release(n);
|
||||
return -EAGAIN;
|
||||
err = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = mlx5_encap_alloc(priv->mdev, e->tunnel_type,
|
||||
@ -1510,8 +1510,8 @@ static int mlx5e_create_encap_header_ipv6(struct mlx5e_priv *priv,
|
||||
|
||||
if (!(nud_state & NUD_VALID)) {
|
||||
neigh_event_send(n, NULL);
|
||||
neigh_release(n);
|
||||
return -EAGAIN;
|
||||
err = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = mlx5_encap_alloc(priv->mdev, e->tunnel_type,
|
||||
|
Loading…
Reference in New Issue
Block a user