net/mlx5e: Fix possible memory leak
Subsystems (5)
PATCH 1/1 net/mlx5e: Fix possible memory leak
From: Wei Yongjun <[email protected]>
'encap_header' is malloced and should be freed before leaving from the error handling cases, otherwise it will cause memory leak.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +4 -4
@@ -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,
Quoted 27 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
'
encap_header' is malloced and should be freed before leaving from the error handling cases, otherwise it will cause memory leak.Fixes 232c001398ae ("net/mlx5e: Add support to neighbour update flow")Signed-off-by Wei Yongjun <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +2
-2@@ -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,
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c static int mlx5e_create_encap_header_ipv6(struct mlx5e_priv *priv, · line 1515
Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +2
-2@@ -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; }
Quoted 7 lines
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +0
-1err = mlx5_encap_alloc(priv->mdev, e->tunnel_type, --To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Wei Yongjun <[email protected]>
Date: Thu, 18 May 2017 15:34:41 +0000
Quoted 7 lines
From: Wei Yongjun <[email protected]>
'
encap_header' is malloced and should be freed before leaving from the error handling cases, otherwise it will cause memory leak.Fixes 232c001398ae ("net/mlx5e: Add support to neighbour update flow")Signed-off-by Wei Yongjun <[email protected]>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html