summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorChen Liangjun <b36089@freescale.com>2012-07-30 17:31:32 +0800
committerEric Nelson <eric.nelson@boundarydevices.com>2012-08-28 09:50:23 -0700
commit79d0f8c80c1d4857d254726f8f9622cb4edfe449 (patch)
tree654553d18fdf2cc661186f6c88f36f2d1b1a90d6 /sound
parent3726f7418b3d0974a00be8303d93a19b71de66ac (diff)
ENGR00218807 ESAI: fix bootup issue cause by accessing unexist address
To support p2p playback, ESAI driver would copy platform data to esai_asrc struct. The platform data only exist on boards that supports ESAI. However, for ARM2 board, it supports ESAI but not necessary get the codec CS42888. Thus the probe() in ESAI driver would also try to copy the platform data from board init file. The p2p playback now only support ARD board, so the ESAI probe() for ARM2 would access unexisted address and cause an kernel dump. In the patch, check the platform data address before copy. Signed-off-by: Chen Liangjun <b36089@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/imx/imx-cs42888.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/imx/imx-cs42888.c b/sound/soc/imx/imx-cs42888.c
index 5fc128a4aacb..e06b1a7fc314 100644
--- a/sound/soc/imx/imx-cs42888.c
+++ b/sound/soc/imx/imx-cs42888.c
@@ -376,7 +376,9 @@ static int __devinit imx_3stack_cs42888_probe(struct platform_device *pdev)
imx_3stack_dai[1].codec_name = plat_data->codec_name;
}
esai_asrc = kzalloc(sizeof(struct asrc_p2p_params), GFP_KERNEL);
- memcpy(esai_asrc, plat_data->priv, sizeof(struct asrc_p2p_params));
+ if (plat_data->priv)
+ memcpy(esai_asrc, plat_data->priv,
+ sizeof(struct asrc_p2p_params));
return 0;
}