OpenCloudOS-Kernel/sound/soc/amd
Gustavo A. R. Silva 4cb79ef9c6
ASoC: amd: Fix potential NULL pointer dereference
Check return value from call to devm_kzalloc() in order to prevent a
potential NULL pointer dereference.

Also, notice that it makes no sense to allocate any resources if
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); fails,
so move the call to devm_kzalloc() below the mentioned code.

Lastly, improve the use of sizeof in the call to devm_kzalloc() by
changing it from sizeof(struct i2s_dev_data) to sizeof(*adata)

This issue was detected with the help of Coccinelle.

Fixes: ac289c7ec0 ("ASoC: amd: add ACP3x PCM platform driver")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-15 19:06:23 +00:00
..
include ASoC: AMD : add ACP 2.2 register headers 2016-01-10 12:44:10 +00:00
raven ASoC: amd: Fix potential NULL pointer dereference 2019-01-15 19:06:23 +00:00
Kconfig ASoC: amd: Fixed build errors 2018-11-15 11:18:57 -08:00
Makefile ASoC: amd: enable acp3x drivers build 2018-11-13 11:44:12 -08:00
acp-da7219-max98357a.c ASoC: AMD: constify regulator_desc structure 2018-11-05 11:25:57 +00:00
acp-pcm-dma.c ASoC: use dma_ops of parent device for acp_audio_dma 2018-12-06 12:55:28 +00:00
acp-rt5645.c ASoC: rt5645/rt5677: replace codec to component 2018-02-12 11:18:44 +00:00
acp.h ASoC: use DMA addr rather than CPU pa for acp_audio_dma 2018-12-06 12:53:04 +00:00