Skip to content

Commit

Permalink
[media] adp1653: check platform_data before usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Mauro Carvalho Chehab committed Aug 6, 2011
1 parent 680417b commit 5720642
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/video/adp1653.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client,
struct adp1653_flash *flash;
int ret;

/* we couldn't work without platform data */
if (client->dev.platform_data == NULL)
return -ENODEV;

flash = kzalloc(sizeof(*flash), GFP_KERNEL);
if (flash == NULL)
return -ENOMEM;
Expand Down

0 comments on commit 5720642

Please sign in to comment.