Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764014AbZCNBij (ORCPT ); Fri, 13 Mar 2009 21:38:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754345AbZCNBUx (ORCPT ); Fri, 13 Mar 2009 21:20:53 -0400 Received: from kroah.org ([198.145.64.141]:35260 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753691AbZCNBUc (ORCPT ); Fri, 13 Mar 2009 21:20:32 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Fri Mar 13 18:10:38 2009 Message-Id: <20090314011038.802911946@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 13 Mar 2009 18:10:27 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Lubomir Rintel , Dave Airlie Subject: [patch 050/114] intel-agp: fix a panic with 1M of shared memory, no GTT entries References: <20090314010937.416083662@mini.kroah.org> Content-Disposition: inline; filename=intel-agp-fix-a-panic-with-1m-of-shared-memory-no-gtt-entries.patch In-Reply-To: <20090314011649.GA26170@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1733 Lines: 46 2.6.28-stable review patch. If anyone has any objections, please let us know. ------------------ From: Lubomir Rintel commit 9c1e8a4ebcc04226cb6f3a1bf1d72f4cafd6b089 upstream. When GTT size is equal to amount of video memory, the amount of GTT entries is computed lower than zero, which is invalid and leads to off-by-one error in intel_i915_configure() Originally posted here: http://bugzilla.kernel.org/show_bug.cgi?id=12539 http://bugzilla.redhat.com/show_bug.cgi?id=445592 Signed-off-by: Lubomir Rintel Cc: Lubomir Rintel Cc: Dave Airlie Reviewed-by: Eric Anholt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/char/agp/intel-agp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -633,13 +633,15 @@ static void intel_i830_init_gtt_entries( break; } } - if (gtt_entries > 0) + if (gtt_entries > 0) { dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n", gtt_entries / KB(1), local ? "local" : "stolen"); - else + gtt_entries /= KB(4); + } else { dev_info(&agp_bridge->dev->dev, "no pre-allocated video memory detected\n"); - gtt_entries /= KB(4); + gtt_entries = 0; + } intel_private.gtt_entries = gtt_entries; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/