mfd: Check t7l66 platform_data pointer
Samuel Ortiz [Fri, 19 Mar 2010 11:46:28 +0000 (12:46 +0100)]
We should check for pdata being not NULL before dereferencing it.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

drivers/mfd/t7l66xb.c

index da6383a..5041d33 100644 (file)
@@ -318,6 +318,9 @@ static int t7l66xb_probe(struct platform_device *dev)
        struct resource *iomem, *rscr;
        int ret;
 
+       if (pdata == NULL)
+               return -EINVAL;
+
        iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
        if (!iomem)
                return -EINVAL;