Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net,rcu: convert call_rcu(xt_osf_finger_free_rcu) to kfree_rcu()

The rcu callback xt_osf_finger_free_rcu() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(xt_osf_finger_free_rcu).

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>

authored by

Lai Jiangshan and committed by
Paul E. McKenney
88b4a034 a74ce142

+2 -9
+2 -9
net/netfilter/xt_osf.c
··· 62 62 [OSF_ATTR_FINGER] = { .len = sizeof(struct xt_osf_user_finger) }, 63 63 }; 64 64 65 - static void xt_osf_finger_free_rcu(struct rcu_head *rcu_head) 66 - { 67 - struct xt_osf_finger *f = container_of(rcu_head, struct xt_osf_finger, rcu_head); 68 - 69 - kfree(f); 70 - } 71 - 72 65 static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb, 73 66 const struct nlmsghdr *nlh, 74 67 const struct nlattr * const osf_attrs[]) ··· 126 133 * We are protected by nfnl mutex. 127 134 */ 128 135 list_del_rcu(&sf->finger_entry); 129 - call_rcu(&sf->rcu_head, xt_osf_finger_free_rcu); 136 + kfree_rcu(sf, rcu_head); 130 137 131 138 err = 0; 132 139 break; ··· 407 414 408 415 list_for_each_entry_rcu(f, &xt_osf_fingers[i], finger_entry) { 409 416 list_del_rcu(&f->finger_entry); 410 - call_rcu(&f->rcu_head, xt_osf_finger_free_rcu); 417 + kfree_rcu(f, rcu_head); 411 418 } 412 419 } 413 420 rcu_read_unlock();