OSDN Git Service

s390: fix normalization bug in exception table sorting
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / arch / s390 / mm / extable.c
index 4d1ee88..18c8b81 100644 (file)
@@ -52,12 +52,16 @@ void sort_extable(struct exception_table_entry *start,
        int i;
 
        /* Normalize entries to being relative to the start of the section */
-       for (p = start, i = 0; p < finish; p++, i += 8)
+       for (p = start, i = 0; p < finish; p++, i += 8) {
                p->insn += i;
+               p->fixup += i + 4;
+       }
        sort(start, finish - start, sizeof(*start), cmp_ex, NULL);
        /* Denormalize all entries */
-       for (p = start, i = 0; p < finish; p++, i += 8)
+       for (p = start, i = 0; p < finish; p++, i += 8) {
                p->insn -= i;
+               p->fixup -= i + 4;
+       }
 }
 
 #ifdef CONFIG_MODULES