On Tue, 2016-03-29 at 12:35 +0300, Emmanuel Grumbach wrote:
> 
> +void ieee80211_nan_func_match(struct ieee80211_vif *vif,
> +                           struct cfg80211_nan_match_params
> *match,
> +                           gfp_t gfp)
> +{
> +     struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> +     struct ieee80211_nan_func *func;
> +     struct wireless_dev *wdev;
> +
> +     if (WARN_ON(vif->type != NL80211_IFTYPE_NAN))
> +             return;
> +
> +     spin_lock_bh(&sdata->u.nan.func_lock);
> +
> +     func = ieee80211_find_nan_func(sdata, match->inst_id);
> +     if (WARN_ON(!func)) {
> +             spin_unlock_bh(&sdata->u.nan.func_lock);
> +             return;
> +     }
> +     match->cookie = func->func.cookie;
> 
Ok maybe this requires a spinlock - due to how drivers want to call it
- but could also use RCU? Particularly with IDR that shouldn't be
difficult.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to