[PATCH] agp/intel: Fix wrong kunmap in i830_cleanup()

Takashi Iwai tiwai at suse.de
Mon Nov 29 03:09:43 PST 2010


Add a missing NULL check and fix the wrong address passed to kunmap()
in i830_cleanup().

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 drivers/char/agp/intel-gtt.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 9272c38..16a2847 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -812,8 +812,10 @@ static int intel_fake_agp_fetch_size(void)
 
 static void i830_cleanup(void)
 {
-	kunmap(intel_private.i8xx_page);
-	intel_private.i8xx_flush_page = NULL;
+	if (intel_private.i8xx_flush_page) {
+		kunmap(intel_private.i8xx_flush_page);
+		intel_private.i8xx_flush_page = NULL;
+	}
 
 	__free_page(intel_private.i8xx_page);
 	intel_private.i8xx_page = NULL;
-- 
1.7.3.1



More information about the dri-devel mailing list