]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: imx-audmix: check return value of devm_kasprintf()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 14 Jun 2023 12:15:09 +0000 (15:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:37:15 +0000 (08:37 +0200)
commit6f64558b43cf6b0849a439eed648ea438e32eb91
tree099a90aa51b5bfdb33b599ff0e97962c376ff7dc
parent35455616110bd9670e0bd1482d0b9ca7affb7781
ASoC: imx-audmix: check return value of devm_kasprintf()

[ Upstream commit 2f76e1d6ca524a888d29aafe29f2ad2003857971 ]

devm_kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: b86ef5367761 ("ASoC: fsl: Add Audio Mixer machine driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230614121509.443926-1-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/fsl/imx-audmix.c