Skip to content

Commit

Permalink
[PATCH] ioremap balanced with iounmap for drivers/video/atyfb_base
Browse files Browse the repository at this point in the history
ioremap must be balanced by an iounmap and failing to do so can result in a
memory leak.

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Amol Lad authored and Linus Torvalds committed Dec 8, 2006
1 parent d8b8c0a commit b2a85ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/video/aty/atyfb_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b2a85ae

Please sign in to comment.