diff options
author | Gao Feng <fgao@ikuai8.com> | 2016-12-06 19:44:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-07 13:21:21 -0500 |
commit | 48140a210b450db229cc9dd927480f65537dc7eb (patch) | |
tree | 0078eb96dc44fa67f8cad6e5ebf5678991820352 /drivers/net/ipvlan/ipvlan_main.c | |
parent | ef0915cacd04c9e35be5f9d62a4e4b5b4b9bcfd1 (diff) |
driver: ipvlan: Free ipvl_port directly with kfree instead of kfree_rcu
There are two functions which would free the ipvl_port now. The first
is ipvlan_port_create. It frees the ipvl_port in the error handler,
so it could kfree it directly. The second is ipvlan_port_destroy. It
invokes netdev_rx_handler_unregister which enforces one grace period
by synchronize_net firstly, so it also could kfree the ipvl_port
directly and safely.
So it is unnecessary to use kfree_rcu to free ipvl_port.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_main.c')
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 5430460167b5..ffe8994e64fc 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -128,7 +128,7 @@ static int ipvlan_port_create(struct net_device *dev) | |||
128 | return 0; | 128 | return 0; |
129 | 129 | ||
130 | err: | 130 | err: |
131 | kfree_rcu(port, rcu); | 131 | kfree(port); |
132 | return err; | 132 | return err; |
133 | } | 133 | } |
134 | 134 | ||
@@ -145,7 +145,7 @@ static void ipvlan_port_destroy(struct net_device *dev) | |||
145 | netdev_rx_handler_unregister(dev); | 145 | netdev_rx_handler_unregister(dev); |
146 | cancel_work_sync(&port->wq); | 146 | cancel_work_sync(&port->wq); |
147 | __skb_queue_purge(&port->backlog); | 147 | __skb_queue_purge(&port->backlog); |
148 | kfree_rcu(port, rcu); | 148 | kfree(port); |
149 | } | 149 | } |
150 | 150 | ||
151 | #define IPVLAN_FEATURES \ | 151 | #define IPVLAN_FEATURES \ |