aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/vesafb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index f3069b01e248..9ed1a931dd31 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -389,10 +389,11 @@ static int __init vesafb_probe(struct device *device)
389 unsigned int temp_size = size_total; 389 unsigned int temp_size = size_total;
390 /* Find the largest power-of-two */ 390 /* Find the largest power-of-two */
391 while (temp_size & (temp_size - 1)) 391 while (temp_size & (temp_size - 1))
392 temp_size &= (temp_size - 1); 392 temp_size &= (temp_size - 1);
393 393
394 /* Try and find a power of two to add */ 394 /* Try and find a power of two to add */
395 while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) { 395 while (temp_size > PAGE_SIZE &&
396 mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) {
396 temp_size >>= 1; 397 temp_size >>= 1;
397 } 398 }
398 } 399 }