From 5c75f4beed9b3e540d8be0f31947c7d8e3271703 Mon Sep 17 00:00:00 2001 From: Andy Zhou Date: Mon, 23 Jun 2014 23:00:55 -0700 Subject: [PATCH] datapath: fix sparse warning in function tbl_mask_array_delete_mask() Sparse gives "incompatible types in comparison expression (different address spaces)" warning messages. Fix this by add rcu_dereference() wrappers. Reported-by: Ben Pfaff Signed-off-by: Andy Zhou Acked-by: Pravin B Shelar --- datapath/flow_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datapath/flow_table.c b/datapath/flow_table.c index 41f7cb86e72..9746822e5d1 100644 --- a/datapath/flow_table.c +++ b/datapath/flow_table.c @@ -286,10 +286,10 @@ static void tbl_mask_array_delete_mask(struct mask_array *ma, * */ for (i = 0; i < ma->count; i++) - if (mask == ma->masks[i]) { + if (mask == ovsl_dereference(ma->masks[i])) { struct sw_flow_mask *last; - last = ma->masks[ma->count - 1]; + last = ovsl_dereference(ma->masks[ma->count - 1]); rcu_assign_pointer(ma->masks[i], last); ma->count--; break; @@ -297,7 +297,7 @@ static void tbl_mask_array_delete_mask(struct mask_array *ma, /* Remove the deleted mask pointers from the invalid section. */ for (i = ma->count; i < ma->max; i++) - if (mask == ma->masks[i]) + if (mask == ovsl_dereference(ma->masks[i])) RCU_INIT_POINTER(ma->masks[i], NULL); }