Skip to content

Commit

Permalink
mfd: Check t7l66 platform_data pointer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed May 27, 2010
1 parent c5617b2 commit 9ad285d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mfd/t7l66xb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9ad285d

Please sign in to comment.