Commit 8224c3b1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

drivers/video/w100fb.c: avoid a couple of error-path NULL derefs

Fix a couple of error-patch oopses identified by Marcio Buss in
http://bugzilla.kernel.org/show_bug.cgi?id=9567.

Cc: Marcio Buss <marciobuss@gmail.com>
Cc: Jeff Zhou <xinzhou.sjtu@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0e170c72
...@@ -765,8 +765,10 @@ int __init w100fb_probe(struct platform_device *pdev) ...@@ -765,8 +765,10 @@ int __init w100fb_probe(struct platform_device *pdev)
printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id);
return 0; return 0;
out: out:
fb_dealloc_cmap(&info->cmap); if (info) {
kfree(info->pseudo_palette); fb_dealloc_cmap(&info->cmap);
kfree(info->pseudo_palette);
}
if (remapped_fbuf != NULL) if (remapped_fbuf != NULL)
iounmap(remapped_fbuf); iounmap(remapped_fbuf);
if (remapped_regs != NULL) if (remapped_regs != NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment