On Wed, 2014-12-03 at 18:08 +0200, Arik Nemtsov wrote: > * @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set > - * regulatory domain. > + * regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device > + * has a private regulatory domain, it will be returned. Otherwise, the > + * global regdomain will be returned. > + * A device will have a private regulatory domain if it uses the > + * regulatory_hint() API. Even when a private regdomain is used the channel > + * information will still be mended according to further hints from > + * the regulatory core to help with compliance. I think you need to document the new availability of the dump version of this now. > + if (!regdom && !cfg80211_regdomain) { I'm not sure why sparse doesn't warn here, but I think that should probably use rcu_access_pointer(cfg80211_regdomain). More realistically, the regdomain can never be NULL I think, so is that even needed? OTOH, if it can be NULL, then you must make this check after the rcu_dereference, which would make this code easier to follow. > + nlmsg_free(msg); > + return -EINVAL; > + } > + > + if (!wiphy && reg_last_request_cell_base() && > + nla_put_u32(msg, NL80211_ATTR_USER_REG_HINT_TYPE, > + NL80211_USER_REG_HINT_CELL_BASE)) > + goto nla_put_failure; > + > + rcu_read_lock(); > + > + if (!regdom) > + regdom = rcu_dereference(cfg80211_regdomain); i.e. move the check into this if here johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html