[S390] memory leak with RCU_TABLE_FREE
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / s390 / mm / pgtable.c
index 5d56c2b95b14a1298c4b3dffa0759e69588fa7c4..529a08838376a5383e6a0973c12b00cde8639920 100644 (file)
@@ -662,8 +662,9 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table)
 
 void __tlb_remove_table(void *_table)
 {
-       void *table = (void *)((unsigned long) _table & PAGE_MASK);
-       unsigned type = (unsigned long) _table & ~PAGE_MASK;
+       const unsigned long mask = (FRAG_MASK << 4) | FRAG_MASK;
+       void *table = (void *)((unsigned long) _table & ~mask);
+       unsigned type = (unsigned long) _table & mask;
 
        if (type)
                __page_table_free_rcu(table, type);