Search Linux Wireless

Re: [PATCH] mac80211: use BUG_ON and return -EINVAL if rate_lowest_index() fails

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

 



On 06/16/2011 05:08 AM, Arend van Spriel wrote:
On 06/16/2011 12:02 AM, Pavel Roskin wrote:

- WARN_ON(1);
+ /* If we cannot find any rate, we are in trouble. */
+ BUG_ON(1);

- return 0;
+ return -EINVAL;
}

I would expect some description what the caller should do when -EINVAL
is returned. Could even argue whether you want a BUG_ON or allow the
caller (driver) to reset the hardware, reassociate, etc. upon -EINVAL. I
am not sure under which circumstances this could happen so there may
really be no way out.

I'm proposing a simple change that replaces memory corruption and unpredictable behavior with a predictable stop. If sysrq is enabled, the system can even be restarted by the keyboard.

The meaning of -EINVAL is symbolic. It shows that we are not returning a fallback value. There is no valid fallback value to return.

The callers should not try to initialize rate control on interfaces with no rates enabled. Anyway, the fix is out of scope of my patch.

--
Regards,
Pavel Roskin
--
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