From: Li RongQing Date: Sun, 30 Sep 2018 07:06:06 +0000 (+0800) Subject: xfrm: fix gro_cells leak when remove virtual xfrm interfaces X-Git-Tag: v4.19~18^2~5^2~3 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4da402597c2b75c4b636ab2416baf921b363b325;p=uclinux-h8%2Flinux.git xfrm: fix gro_cells leak when remove virtual xfrm interfaces The device gro_cells has been initialized, it should be freed, otherwise it will be leaked Fixes: f203b76d78092faf2 ("xfrm: Add virtual xfrm interfaces") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing Signed-off-by: Steffen Klassert --- diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c index 31acc6f33d98..6f05e831a73e 100644 --- a/net/xfrm/xfrm_interface.c +++ b/net/xfrm/xfrm_interface.c @@ -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); }