Skip to content

Commit

Permalink
driver: macvlan: Remove the rcu member of macvlan_port
Browse files Browse the repository at this point in the history
When free macvlan_port in macvlan_port_destroy, it is safe to free
directly because netdev_rx_handler_unregister could enforce one
grace period.
So it is unnecessary to use kfree_rcu for macvlan_port.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gao Feng authored and David S. Miller committed Dec 7, 2016
1 parent 48140a2 commit a1f5315
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct macvlan_port {
struct net_device *dev;
struct hlist_head vlan_hash[MACVLAN_HASH_SIZE];
struct list_head vlans;
struct rcu_head rcu;
struct sk_buff_head bc_queue;
struct work_struct bc_work;
bool passthru;
Expand Down Expand Up @@ -1151,7 +1150,7 @@ static void macvlan_port_destroy(struct net_device *dev)
cancel_work_sync(&port->bc_work);
__skb_queue_purge(&port->bc_queue);

kfree_rcu(port, rcu);
kfree(port);
}

static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[])
Expand Down

0 comments on commit a1f5315

Please sign in to comment.