From: Amol Lad Date: Fri, 8 Dec 2006 10:40:14 +0000 (-0800) Subject: [PATCH] ioremap balanced with iounmap for drivers/video/atyfb_base X-Git-Tag: v2.6.20-rc1~34^2~100 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b2a85aebf9d6cb671085d58dfbbd7b11269d49eb;p=linux-2.6-omap-h63xx.git [PATCH] ioremap balanced with iounmap for drivers/video/atyfb_base ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Signed-off-by: Amol Lad Cc: "Antonino A. Daplas" Cc: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index e815b354c09..b7b4e61b295 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -3527,6 +3527,10 @@ static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *i atyfb_setup_generic_fail: iounmap(par->ati_regbase); par->ati_regbase = NULL; + if (info->screen_base) { + iounmap(info->screen_base); + info->screen_base = NULL; + } return ret; } @@ -3695,6 +3699,10 @@ static int __devinit atyfb_atari_probe(void) } if (aty_init(info, "ISA bus")) { + if (info->screen_base) + iounmap(info->screen_base); + if (par->ati_regbase) + iounmap(par->ati_regbase); framebuffer_release(info); /* This is insufficient! kernel_map has added two large chunks!! */ return -ENXIO;