]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: remove unsigned less-than-0 comparison
authorMatthew Daley <mattd@bugfuzz.com>
Sun, 1 Dec 2013 10:14:59 +0000 (23:14 +1300)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 2 Dec 2013 12:01:59 +0000 (12:01 +0000)
...from libxl_cpuid_parse_config_xend. value is unsigned so this doesn't
work, and either way the following comparison on it being bigger than 3
does what was intended here anyway.

Coverity-ID: 1055614
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_cpuid.c

index e1c406c54073c310310e6fbe1ade14bc723d5a79..dd21b78864d871b32cdb545e27682accc2a12183 100644 (file)
@@ -298,7 +298,7 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *cpuid,
         }
         value = str[1] - 'a';
         endptr = strchr(str, '=');
-        if (value < 0 || value > 3 || endptr == NULL) {
+        if (value > 3 || endptr == NULL) {
             return 4;
         }
         str = endptr + 1;