Fix code to not go out of bounds of "matrix_1" array
and to do what it's supposed to - calculate inversion matrix.

Signed-off-by: Jan Stancek <[email protected]>
---
 testcases/kernel/sched/sched_stress/sched_tc5.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/sched/sched_stress/sched_tc5.c 
b/testcases/kernel/sched/sched_stress/sched_tc5.c
index d242c9e..db5ce96 100644
--- a/testcases/kernel/sched/sched_stress/sched_tc5.c
+++ b/testcases/kernel/sched/sched_stress/sched_tc5.c
@@ -210,7 +210,7 @@ void invert_matrix()
         * Form an identity matrix in the random matrix
         */
        for (i = 0; i < MATRIX_SIZE; i++) {
-               t1 = matrix_1[i][j];
+               t1 = matrix_1[i][i];
                for (j = 0; j < MATRIX_SIZE; j++) {
                        matrix_1[i][j] /= t1;
                        matrix_2[i][j] /= t1;
-- 
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to