Re: [PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-19 Thread Nick Kossifidis
On Tue Feb 19 15:36:07 2013, Jiri Slaby wrote: > On 02/18/2013 01:47 AM, Nick Kossifidis wrote: >> int >> ath5k_eeprom_mode_from_channel(struct ieee80211_channel *channel) >> { >> switch (channel->hw_value) { >> case AR5K_MODE_11A: >> return AR5K_EEPROM_MODE_11A; >>

Re: [PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-19 Thread Jiri Slaby
On 02/18/2013 01:47 AM, Nick Kossifidis wrote: > int > ath5k_eeprom_mode_from_channel(struct ieee80211_channel *channel) > { > switch (channel->hw_value) { > case AR5K_MODE_11A: > return AR5K_EEPROM_MODE_11A; > case AR5K_MODE_11G: > return

Re: [PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-19 Thread Jiri Slaby
On 02/18/2013 01:47 AM, Nick Kossifidis wrote: int ath5k_eeprom_mode_from_channel(struct ieee80211_channel *channel) { switch (channel-hw_value) { case AR5K_MODE_11A: return AR5K_EEPROM_MODE_11A; case AR5K_MODE_11G: return

Re: [PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-19 Thread Nick Kossifidis
On Tue Feb 19 15:36:07 2013, Jiri Slaby wrote: On 02/18/2013 01:47 AM, Nick Kossifidis wrote: int ath5k_eeprom_mode_from_channel(struct ieee80211_channel *channel) { switch (channel-hw_value) { case AR5K_MODE_11A: return AR5K_EEPROM_MODE_11A; case

Re: [PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-17 Thread Nick Kossifidis
2013/2/7 Jiri Slaby : > It can, if invalid argument given, return a negative value. In that > case we would access arrays out-of-bounds and such. Check the value > and yell loudly if that happened as it would be a bug in the > implementation. (Instead of silently corrupting memory.) > >

Re: [PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-17 Thread Nick Kossifidis
2013/2/7 Jiri Slaby jsl...@suse.cz: It can, if invalid argument given, return a negative value. In that case we would access arrays out-of-bounds and such. Check the value and yell loudly if that happened as it would be a bug in the implementation. (Instead of silently corrupting memory.)

[PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-07 Thread Jiri Slaby
It can, if invalid argument given, return a negative value. In that case we would access arrays out-of-bounds and such. Check the value and yell loudly if that happened as it would be a bug in the implementation. (Instead of silently corrupting memory.) Signed-off-by: Jiri Slaby Cc: Nick

[PATCH] NET: ath5k, check ath5k_eeprom_mode_from_channel retval

2013-02-07 Thread Jiri Slaby
It can, if invalid argument given, return a negative value. In that case we would access arrays out-of-bounds and such. Check the value and yell loudly if that happened as it would be a bug in the implementation. (Instead of silently corrupting memory.) Signed-off-by: Jiri Slaby jsl...@suse.cz