Search Linux Wireless

Re: [PATCH 2/2] wireless: Use first phyX name available when registering phy devices.

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

 



On Mon, 2010-09-27 at 09:07 -0700, greearb@xxxxxxxxx wrote:

> @@ -346,16 +332,36 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
>  
>  	if (unlikely(!wiphy_idx_valid(rdev->wiphy_idx))) {
>  		wiphy_counter--;
> +		goto too_many_devs;
> +	}

I believe the other path can also reduce the counter again, since it's
another failure case? Not that I'm really worried about it though.

> +	/* 64k wiphy devices is enough for anyone! */
> +	for (i = 0; i < 0xFFFF; i++) {

Come to think of it, this could be "i <= wiphy_counter", since in N
devices, only N different names can be in use, so checking N+1 names
will be sufficient, right?

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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux