lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Nov 2017 06:27:12 +0000
From:   Wei Yongjun <weiyongjun1@...wei.com>
To:     Pravin Shelar <pshelar@...ira.com>, Andy Zhou <azhou@....org>
CC:     Wei Yongjun <weiyongjun1@...wei.com>, <netdev@...r.kernel.org>,
        <dev@...nvswitch.org>
Subject: [PATCH net-next] openvswitch: Using kfree_rcu() to simplify the code

The callback function of call_rcu() just calls a kfree(), so we
can use kfree_rcu() instead of call_rcu() + callback function.

Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
 net/openvswitch/meter.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index 2a5ba35..f9e2b1f 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -42,19 +42,12 @@
 	[OVS_BAND_ATTR_STATS] = { .len = sizeof(struct ovs_flow_stats) },
 };
 
-static void rcu_free_ovs_meter_callback(struct rcu_head *rcu)
-{
-	struct dp_meter *meter = container_of(rcu, struct dp_meter, rcu);
-
-	kfree(meter);
-}
-
 static void ovs_meter_free(struct dp_meter *meter)
 {
 	if (!meter)
 		return;
 
-	call_rcu(&meter->rcu, rcu_free_ovs_meter_callback);
+	kfree_rcu(meter, rcu);
 }
 
 static struct hlist_head *meter_hash_bucket(const struct datapath *dp,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ