From: Nathan F. <nf...@au...> - 2009-09-08 17:56:52
|
The current bounds checking only validates that the specified smt setting is not zero and less than or equal to the threads per cpu on the system. This causes smt settings such as 4000000000 to be converted to some negative number and thus odd smt settings ensue. This patch ensures checks to make the smt setting specified is not less than or equal to zero. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2009-09-04 14:17:25.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2009-09-08 15:09:32.000000000 -0500 @@ -293,7 +293,7 @@ else smt_state = strtol(state, NULL, 0); - if ((smt_state == 0) || (smt_state > threads_per_cpu)) { + if ((smt_state <= 0) || (smt_state > threads_per_cpu)) { printf("SMT=%s is not valid\n", state); return -1; } |