[PATCH] i386: fix buggy MTRR address checks
[profile/ivi/kernel-adaptation-intel-automotive.git] / arch / i386 / kernel / cpu / mtrr / generic.c
index 0b61eed..ee8dc67 100644 (file)
@@ -366,7 +366,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i
                        printk(KERN_WARNING "mtrr: base(0x%lx000) is not 4 MiB aligned\n", base);
                        return -EINVAL;
                }
-               if (!(base + size < 0x70000000 || base > 0x7003FFFF) &&
+               if (!(base + size < 0x70000 || base > 0x7003F) &&
                    (type == MTRR_TYPE_WRCOMB
                     || type == MTRR_TYPE_WRBACK)) {
                        printk(KERN_WARNING "mtrr: writable mtrr between 0x70000000 and 0x7003FFFF may hang the CPU.\n");
@@ -374,7 +374,7 @@ int generic_validate_add_page(unsigned long base, unsigned long size, unsigned i
                }
        }
 
-       if (base + size < 0x100) {
+       if (base < 0x100) {
                printk(KERN_WARNING "mtrr: cannot set region below 1 MiB (0x%lx000,0x%lx000)\n",
                       base, size);
                return -EINVAL;