From 6f20002c1201c1fc78fc7cedb49b103d8afe9da6 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 24 Dec 2010 19:44:34 -0800 Subject: [PATCH] datapath: Use get_table_protected() in additional places. There are several places where the flow table is accessed without any kind of RCU protection. This is fine because dp mutex is held so this adds checks for that condition. Found with sparse. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- datapath/datapath.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 2be0ce12..bf9fc820 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -286,7 +286,7 @@ static int create_dp(int dp_idx, const char __user *devnamep) err_destroy_local_port: dp_detach_port(dp->ports[ODPP_LOCAL]); err_destroy_table: - tbl_destroy(dp->table, NULL); + tbl_destroy(get_table_protected(dp), NULL); err_free_dp: kfree(dp); err_put_module: @@ -312,8 +312,7 @@ static void do_destroy_dp(struct datapath *dp) rcu_assign_pointer(dps[dp->dp_idx], NULL); dp_detach_port(dp->ports[ODPP_LOCAL]); - - tbl_destroy(dp->table, flow_free_tbl); + tbl_destroy(get_table_protected(dp), flow_free_tbl); for (i = 0; i < DP_N_QUEUES; i++) skb_queue_purge(&dp->queues[i]); -- 2.30.2