Skip to content

Commit

Permalink
datapath: fix sparse warning in function tbl_mask_array_delete_mask()
Browse files Browse the repository at this point in the history
Sparse gives "incompatible types in comparison expression (different
address spaces)" warning messages. Fix this by add rcu_dereference()
wrappers.

Reported-by: Ben Pfaff <[email protected]>
Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Pravin B Shelar <[email protected]>
  • Loading branch information
azhou-nicira committed Jun 25, 2014
1 parent 1ffd16a commit 5c75f4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datapath/flow_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,18 @@ static void tbl_mask_array_delete_mask(struct mask_array *ma,
* </Note>
*/
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;
}

/* 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);
}

Expand Down

0 comments on commit 5c75f4b

Please sign in to comment.