diff options
author | Andrey Utkin <andrey.krieger.utkin@gmail.com> | 2014-07-17 09:56:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-07-18 13:45:25 -0400 |
commit | 3f5572020c4829e749716f2c31b5107417d5a96d (patch) | |
tree | c692198b2b7689f87d0e63d5336807e6f2ae09e9 /drivers/net/wireless/ath | |
parent | 3ae351abf15f984c02feb9aab5394443e9efb00a (diff) |
ath9k: drop negativity checks for unsigned values coming from kstrtoul()
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80471
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80481
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/spectral.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index ce073e995dfe..d2279365be6f 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -202,7 +202,7 @@ static ssize_t write_file_ani(struct file *file, | |||
202 | if (kstrtoul(buf, 0, &ani)) | 202 | if (kstrtoul(buf, 0, &ani)) |
203 | return -EINVAL; | 203 | return -EINVAL; |
204 | 204 | ||
205 | if (ani < 0 || ani > 1) | 205 | if (ani > 1) |
206 | return -EINVAL; | 206 | return -EINVAL; |
207 | 207 | ||
208 | common->disable_ani = !ani; | 208 | common->disable_ani = !ani; |
diff --git a/drivers/net/wireless/ath/ath9k/spectral.c b/drivers/net/wireless/ath/ath9k/spectral.c index 99f4de95c264..5fe29b9f8fa2 100644 --- a/drivers/net/wireless/ath/ath9k/spectral.c +++ b/drivers/net/wireless/ath/ath9k/spectral.c | |||
@@ -313,7 +313,7 @@ static ssize_t write_file_spectral_short_repeat(struct file *file, | |||
313 | if (kstrtoul(buf, 0, &val)) | 313 | if (kstrtoul(buf, 0, &val)) |
314 | return -EINVAL; | 314 | return -EINVAL; |
315 | 315 | ||
316 | if (val < 0 || val > 1) | 316 | if (val > 1) |
317 | return -EINVAL; | 317 | return -EINVAL; |
318 | 318 | ||
319 | sc->spec_config.short_repeat = val; | 319 | sc->spec_config.short_repeat = val; |
@@ -361,7 +361,7 @@ static ssize_t write_file_spectral_count(struct file *file, | |||
361 | if (kstrtoul(buf, 0, &val)) | 361 | if (kstrtoul(buf, 0, &val)) |
362 | return -EINVAL; | 362 | return -EINVAL; |
363 | 363 | ||
364 | if (val < 0 || val > 255) | 364 | if (val > 255) |
365 | return -EINVAL; | 365 | return -EINVAL; |
366 | 366 | ||
367 | sc->spec_config.count = val; | 367 | sc->spec_config.count = val; |
@@ -409,7 +409,7 @@ static ssize_t write_file_spectral_period(struct file *file, | |||
409 | if (kstrtoul(buf, 0, &val)) | 409 | if (kstrtoul(buf, 0, &val)) |
410 | return -EINVAL; | 410 | return -EINVAL; |
411 | 411 | ||
412 | if (val < 0 || val > 255) | 412 | if (val > 255) |
413 | return -EINVAL; | 413 | return -EINVAL; |
414 | 414 | ||
415 | sc->spec_config.period = val; | 415 | sc->spec_config.period = val; |
@@ -457,7 +457,7 @@ static ssize_t write_file_spectral_fft_period(struct file *file, | |||
457 | if (kstrtoul(buf, 0, &val)) | 457 | if (kstrtoul(buf, 0, &val)) |
458 | return -EINVAL; | 458 | return -EINVAL; |
459 | 459 | ||
460 | if (val < 0 || val > 15) | 460 | if (val > 15) |
461 | return -EINVAL; | 461 | return -EINVAL; |
462 | 462 | ||
463 | sc->spec_config.fft_period = val; | 463 | sc->spec_config.fft_period = val; |