From: Jesse Gross Date: Sat, 25 Dec 2010 03:44:34 +0000 (-0800) Subject: datapath: Use get_table_protected() in additional places. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f20002c1201c1fc78fc7cedb49b103d8afe9da6;p=openvswitch 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 --- 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]);