diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-01-16 18:57:58 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-22 15:27:11 +0100 |
commit | 0707cfa5c3ef58effb143db9db6d6e20503f9dec (patch) | |
tree | f041064a7ada317cc4a11f7b4d3efeeaca6ebf13 /crypto/rmd256.c | |
parent | cpu-topology: Don't error on more than CONFIG_NR_CPUS CPUs in device tree (diff) | |
download | linux-0707cfa5c3ef58effb143db9db6d6e20503f9dec.tar.xz linux-0707cfa5c3ef58effb143db9db6d6e20503f9dec.zip |
driver core: platform: fix u32 greater or equal to zero comparison
Currently the check that a u32 variable i is >= 0 is always true because
the unsigned variable will never be negative, causing the loop to run
forever. Fix this by changing the pre-decrement check to a zero check on
i followed by a decrement of i.
Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 39cc539f90d0 ("driver core: platform: Prevent resouce overflow from causing infinite loops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20200116175758.88396-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto/rmd256.c')
0 files changed, 0 insertions, 0 deletions