From: Andrew Morton Date: Mon, 28 Apr 2008 09:15:45 +0000 (-0700) Subject: drivers/video/w100fb.c: avoid a couple of error-path NULL derefs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8224c3b166db81a8dbd128df455453897fe2b48b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Jeff Zhou Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 003c49a490eb..30469bf906e5 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c @@ -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); return 0; out: - fb_dealloc_cmap(&info->cmap); - kfree(info->pseudo_palette); + if (info) { + fb_dealloc_cmap(&info->cmap); + kfree(info->pseudo_palette); + } if (remapped_fbuf != NULL) iounmap(remapped_fbuf); if (remapped_regs != NULL)