diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2011-07-25 10:16:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-08-06 08:42:50 -0400 |
commit | 572064280ecc9dc89227cf3797bc2144896a34f5 (patch) | |
tree | e1cb5154c5ddffe7d88f5a807a9b0e8e88460917 /drivers | |
parent | 680417bb318adc5f1f8f392730776176fbcdedd8 (diff) |
[media] adp1653: check platform_data before usage
The driver requires platform_data to be present. That's why we need to check
and fail in case of the absence of necessary data.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/adp1653.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c index be7befd60947..8ad89ffe2cc3 100644 --- a/drivers/media/video/adp1653.c +++ b/drivers/media/video/adp1653.c | |||
@@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client, | |||
413 | struct adp1653_flash *flash; | 413 | struct adp1653_flash *flash; |
414 | int ret; | 414 | int ret; |
415 | 415 | ||
416 | /* we couldn't work without platform data */ | ||
417 | if (client->dev.platform_data == NULL) | ||
418 | return -ENODEV; | ||
419 | |||
416 | flash = kzalloc(sizeof(*flash), GFP_KERNEL); | 420 | flash = kzalloc(sizeof(*flash), GFP_KERNEL); |
417 | if (flash == NULL) | 421 | if (flash == NULL) |
418 | return -ENOMEM; | 422 | return -ENOMEM; |