From: Li RongQing <lirongq...@baidu.com>

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 <zhangy...@baidu.com>
Signed-off-by: Li RongQing <lirongq...@baidu.com>
Signed-off-by: Steffen Klassert <steffen.klass...@secunet.com>
---
 net/xfrm/xfrm_interface.c | 3 +++
 1 file changed, 3 insertions(+)

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);
 }
 
-- 
2.17.1

Reply via email to