diff --git a/[refs] b/[refs] index a413c8642368..69b2ed9c9884 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 72414d3f1d22fc3e311b162fca95c430048d38ce +refs/heads/master: d7496cb75ec75b1e74283a481fb02f5d7ce7bdeb diff --git a/trunk/drivers/video/vesafb.c b/trunk/drivers/video/vesafb.c index f3069b01e248..9ed1a931dd31 100644 --- a/trunk/drivers/video/vesafb.c +++ b/trunk/drivers/video/vesafb.c @@ -389,10 +389,11 @@ static int __init vesafb_probe(struct device *device) unsigned int temp_size = size_total; /* Find the largest power-of-two */ while (temp_size & (temp_size - 1)) - temp_size &= (temp_size - 1); - - /* Try and find a power of two to add */ - while (temp_size && mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) { + temp_size &= (temp_size - 1); + + /* Try and find a power of two to add */ + while (temp_size > PAGE_SIZE && + mtrr_add(vesafb_fix.smem_start, temp_size, MTRR_TYPE_WRCOMB, 1)==-EINVAL) { temp_size >>= 1; } }