Skip to content

Commit

Permalink
xfrm: fix gro_cells leak when remove virtual xfrm interfaces
Browse files Browse the repository at this point in the history
The device gro_cells has been initialized, it should be freed,
otherwise it will be leaked

Fixes: f203b76 ("xfrm: Add virtual xfrm interfaces")
Signed-off-by: Zhang Yu <[email protected]>
Signed-off-by: Li RongQing <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
  • Loading branch information
lrq-max authored and klassert committed Oct 2, 2018
1 parent 92d7c74 commit 4da4025
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/xfrm/xfrm_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ static void xfrmi_unlink(struct xfrmi_net *xfrmn, struct xfrm_if *xi)

static void xfrmi_dev_free(struct net_device *dev)
{
struct xfrm_if *xi = netdev_priv(dev);

gro_cells_destroy(&xi->gro_cells);
free_percpu(dev->tstats);
}

Expand Down

0 comments on commit 4da4025

Please sign in to comment.