提交 2741d43a 编写于 作者: S Subhransu S. Prusty 提交者: Mark Brown

ASoC: Intel: mfld-pcm: Allocate platform data

Platform data may be null during platform_device_add. Allocate platform
data before using.
Signed-off-by: NSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 19a23a5d
......@@ -570,7 +570,7 @@ static int sst_platform_probe(struct platform_device *pdev)
{
struct sst_data *drv;
int ret;
struct sst_platform_data *pdata = pdev->dev.platform_data;
struct sst_platform_data *pdata;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
if (drv == NULL) {
......@@ -578,6 +578,12 @@ static int sst_platform_probe(struct platform_device *pdev)
return -ENOMEM;
}
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (pdata == NULL) {
pr_err("kzalloc failed for pdata\n");
return -ENOMEM;
}
pdata->pdev_strm_map = dpcm_strm_map;
pdata->strm_map_size = ARRAY_SIZE(dpcm_strm_map);
drv->pdata = pdata;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册