Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
8224c3b1 0e170c72

+4 -2
+4 -2
drivers/video/w100fb.c
··· 765 765 printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); 766 766 return 0; 767 767 out: 768 - fb_dealloc_cmap(&info->cmap); 769 - kfree(info->pseudo_palette); 768 + if (info) { 769 + fb_dealloc_cmap(&info->cmap); 770 + kfree(info->pseudo_palette); 771 + } 770 772 if (remapped_fbuf != NULL) 771 773 iounmap(remapped_fbuf); 772 774 if (remapped_regs != NULL)