提交 57206428 编写于 作者: A Andy Shevchenko 提交者: Mauro Carvalho Chehab

[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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: NSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 680417bb
...@@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client, ...@@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client,
struct adp1653_flash *flash; struct adp1653_flash *flash;
int ret; int ret;
/* we couldn't work without platform data */
if (client->dev.platform_data == NULL)
return -ENODEV;
flash = kzalloc(sizeof(*flash), GFP_KERNEL); flash = kzalloc(sizeof(*flash), GFP_KERNEL);
if (flash == NULL) if (flash == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册