diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2019-01-14 17:40:10 -0600 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-01-15 19:06:23 +0000 |
commit | 4cb79ef9c6c4413427cd70afbb1f3bc01e9b7abf (patch) | |
tree | 22a94f05834a65bd8fca01cf2d087c0204339366 /drivers/irqchip/irq-gic-pm.c | |
parent | c407cd008fd039320d147088b52d0fa34ed3ddcb (diff) | |
download | linux-4cb79ef9c6c4413427cd70afbb1f3bc01e9b7abf.tar.gz linux-4cb79ef9c6c4413427cd70afbb1f3bc01e9b7abf.tar.bz2 linux-4cb79ef9c6c4413427cd70afbb1f3bc01e9b7abf.zip |
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: ac289c7ec0bc ("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>
Diffstat (limited to 'drivers/irqchip/irq-gic-pm.c')
0 files changed, 0 insertions, 0 deletions