Search Linux Wireless

Re: [PATCH v2 02/10] wifi: cfg80211: add support for advertising multiple radios belonging to a wiphy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux