All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: David Airlie <airlied@linux.ie>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] [resend] intel_agp: Don't oops with zero stolen memory
Date: Wed, 16 Jun 2010 10:13:52 +0200	[thread overview]
Message-ID: <201006161013.53612.linux@rainbow-software.org> (raw)

When "onboard video memory" is set do "disabled" in BIOS on Asus P4P800-VM
board (i865G), kernel oopses with memory corruption:
https://bugs.freedesktop.org/show_bug.cgi?id=28430

Fix that by cleanly aborting the initialization.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

diff -urp linux-2.6.35-rc2-orig/drivers/char/agp/intel-gtt.c linux-2.6.35-rc2/drivers/char/agp/intel-gtt.c
--- linux-2.6.35-rc2-orig/drivers/char/agp/intel-gtt.c	2010-06-06 05:43:24.000000000 +0200
+++ linux-2.6.35-rc2/drivers/char/agp/intel-gtt.c	2010-06-14 19:14:05.000000000 +0200
@@ -797,6 +797,10 @@ static int intel_i830_create_gatt_table(
 
 	/* we have to call this as early as possible after the MMIO base address is known */
 	intel_i830_init_gtt_entries();
+	if (intel_private.gtt_entries == 0) {
+		iounmap(intel_private.registers);
+		return -ENOMEM;
+	}
 
 	agp_bridge->gatt_table = NULL;
 
@@ -1279,6 +1283,11 @@ static int intel_i915_create_gatt_table(
 
 	/* we have to call this as early as possible after the MMIO base address is known */
 	intel_i830_init_gtt_entries();
+	if (intel_private.gtt_entries == 0) {
+		iounmap(intel_private.gtt);
+		iounmap(intel_private.registers);
+		return -ENOMEM;
+	}
 
 	agp_bridge->gatt_table = NULL;
 
@@ -1387,6 +1396,11 @@ static int intel_i965_create_gatt_table(
 
 	/* we have to call this as early as possible after the MMIO base address is known */
 	intel_i830_init_gtt_entries();
+	if (intel_private.gtt_entries == 0) {
+		iounmap(intel_private.gtt);
+		iounmap(intel_private.registers);
+		return -ENOMEM;
+	}
 
 	agp_bridge->gatt_table = NULL;
 

-- 
Ondrej Zary

             reply	other threads:[~2010-06-16  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16  8:13 Ondrej Zary [this message]
2010-07-01 22:44 ` [PATCH] [resend] intel_agp: Don't oops with zero stolen memory Eric Anholt
2010-07-02 19:59   ` Ondrej Zary
2010-07-02 20:57     ` Eric Anholt
2010-07-02 21:54       ` Ondrej Zary
2010-07-05 16:54 ` Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006161013.53612.linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=airlied@linux.ie \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.