When access the array of DPs, we need to hold either rcu_read_lock
or dp_mutex. This enables lockdep to validate those conditions.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
{
if (dp_idx < 0 || dp_idx >= ODP_MAX)
return NULL;
- return rcu_dereference(dps[dp_idx]);
+ return rcu_dereference_check(dps[dp_idx], rcu_read_lock_held() ||
+ lockdep_is_held(&dp_mutex));
}
EXPORT_SYMBOL_GPL(get_dp);