From: Takashi Iwai Date: Sat, 4 Dec 2010 15:13:06 +0000 (+0100) Subject: agp/intel: Fix wrong kunmap in i830_cleanup() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=136711be41ec97f7f1a9c3a5e8535eb7da5fea59;p=linux-beck.git agp/intel: Fix wrong kunmap in i830_cleanup() Add a missing NULL check and fix the wrong address passed to kunmap() in i830_cleanup(). Cc: stable@kernel.org Signed-off-by: Takashi Iwai [danvet: added cc stable] Signed-off-by: Daniel Vetter Signed-off-by: Chris Wilson --- diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9272c38dd3c6..16a2847b7cdb 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;