Oops, forgot one thing already: > +static int nl80211_put_radio(struct wiphy *wiphy, struct sk_buff *msg, int idx) > +{ ... > + const struct wiphy_radio_freq_range *range = &r->freq_range[i]; > + int ret; > + > + freq = nla_nest_start(msg, NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE); need to check freq > + ret = nla_put_u32(msg, NL80211_WIPHY_RADIO_FREQ_ATTR_START, > + range->start_freq) || > + nla_put_u32(msg, NL80211_WIPHY_RADIO_FREQ_ATTR_END, > + range->end_freq); > + nla_nest_end(msg, freq); > + > + if (ret) > + goto nla_put_failure; and this 'ret' business is pointless? You can just 'goto nla_put_failure' even in the middle of the nested, it will be unwound properly on a higher level. johannes