]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/ldt.c
Merge branch 'audit.b51' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[linux-2.6] / arch / x86 / kernel / ldt.c
index 8a7660c8394a5a2ae2362e6d3d4ec032d5def37e..0224c3637c73e68b4566124dd5d825034bc8c07a 100644 (file)
@@ -35,7 +35,8 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
        if (mincount <= pc->size)
                return 0;
        oldsize = pc->size;
-       mincount = (mincount + 511) & (~511);
+       mincount = (mincount + (PAGE_SIZE / LDT_ENTRY_SIZE - 1)) &
+                       (~(PAGE_SIZE / LDT_ENTRY_SIZE - 1));
        if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
                newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
        else