summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-03-19 14:46:28 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2010-05-28 03:37:26 +0400
commit9ad285d6db6e04c1c51c79152d2214fffefc92ab (patch)
tree5239b8d95b3a5a6c9254d82db3201d5791167228
parentc5617b200ac52e35f7e8cf05a17b0a2d50f6b3e9 (diff)
downloadlinux-9ad285d6db6e04c1c51c79152d2214fffefc92ab.tar.xz
mfd: Check t7l66 platform_data pointer
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>
-rw-r--r--drivers/mfd/t7l66xb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index da6383a934ac..5041d33adf0b 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -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;