tmiofb: missing NULL pointer checks
authorAlan Cox <alan@linux.intel.com>
Tue, 24 Jul 2012 12:43:48 +0000 (13:43 +0100)
committerJiri Kosina <jkosina@suse.cz>
Sat, 1 Sep 2012 15:51:03 +0000 (08:51 -0700)
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44471
Reported-by: <rucsoftsec@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/video/tmiofb.c

index 8e4a446b5ed111054ed52f0ff62abbe79edb006d..b244f060f1511554491522889c138fc43cd864ba 100644 (file)
@@ -694,6 +694,10 @@ static int __devinit tmiofb_probe(struct platform_device *dev)
                dev_err(&dev->dev, "NULL platform data!\n");
                return -EINVAL;
        }
+       if (ccr == NULL || lcr == NULL || vram == NULL || irq < 0) {
+               dev_err(&dev->dev, "missing resources\n");
+               return -EINVAL;
+       }
 
        info = framebuffer_alloc(sizeof(struct tmiofb_par), &dev->dev);