Commit 327fc8752a3c08fc7dc7d382883e65aad2f03bde
Committed by
Linus Torvalds
1 parent
cc880a7157
Exists in
master
and in
7 other branches
tgafb: fix cmap memory leak
Fix cmap leak when register_framebuffer fails. Signed-off-by: Andres Salomon <dilinger@debian.org> Acked-by: Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
drivers/video/tgafb.c
... | ... | @@ -1663,7 +1663,7 @@ |
1663 | 1663 | if (register_framebuffer(info) < 0) { |
1664 | 1664 | printk(KERN_ERR "tgafb: Could not register framebuffer\n"); |
1665 | 1665 | ret = -EINVAL; |
1666 | - goto err1; | |
1666 | + goto err2; | |
1667 | 1667 | } |
1668 | 1668 | |
1669 | 1669 | if (tga_bus_pci) { |
... | ... | @@ -1682,6 +1682,8 @@ |
1682 | 1682 | |
1683 | 1683 | return 0; |
1684 | 1684 | |
1685 | + err2: | |
1686 | + fb_dealloc_cmap(&info->cmap); | |
1685 | 1687 | err1: |
1686 | 1688 | if (mem_base) |
1687 | 1689 | iounmap(mem_base); |