Commit 690273fc authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Paul E. McKenney

security,rcu: convert call_rcu(sel_netif_free) to kfree_rcu()

The rcu callback sel_netif_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(sel_netif_free).
Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent b55071eb
...@@ -103,22 +103,6 @@ static int sel_netif_insert(struct sel_netif *netif) ...@@ -103,22 +103,6 @@ static int sel_netif_insert(struct sel_netif *netif)
return 0; return 0;
} }
/**
* sel_netif_free - Frees an interface entry
* @p: the entry's RCU field
*
* Description:
* This function is designed to be used as a callback to the call_rcu()
* function so that memory allocated to a hash table interface entry can be
* released safely.
*
*/
static void sel_netif_free(struct rcu_head *p)
{
struct sel_netif *netif = container_of(p, struct sel_netif, rcu_head);
kfree(netif);
}
/** /**
* sel_netif_destroy - Remove an interface record from the table * sel_netif_destroy - Remove an interface record from the table
* @netif: the existing interface record * @netif: the existing interface record
...@@ -131,7 +115,7 @@ static void sel_netif_destroy(struct sel_netif *netif) ...@@ -131,7 +115,7 @@ static void sel_netif_destroy(struct sel_netif *netif)
{ {
list_del_rcu(&netif->list); list_del_rcu(&netif->list);
sel_netif_total--; sel_netif_total--;
call_rcu(&netif->rcu_head, sel_netif_free); kfree_rcu(netif, rcu_head);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment