ASoC: utils: initialize dummy_codec before use

dummy_codec is not initialized before use, which
could cause kernel panic. Initialize dummy_codec before use.

Change-Id: Iedf7a3accbd14138ab7ed9e4e36a98fd7ca9a839
Signed-off-by: Meng Wang <mwang@codeaurora.org>
This commit is contained in:
Meng Wang 2016-08-30 10:35:49 +08:00 committed by Gerrit - the friendly Code Review server
parent 313ee32d17
commit 2dbcc6fa22
1 changed files with 3 additions and 0 deletions

View File

@ -123,6 +123,9 @@ static int snd_soc_dummy_probe(struct platform_device *pdev)
{
int ret;
memset(&dummy_codec, 0,
sizeof(struct snd_soc_codec_driver));
ret = snd_soc_register_codec(&pdev->dev, &dummy_codec, &dummy_dai, 1);
if (ret < 0)
return ret;