Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: fs210x: Add NULL check in fs210x_register_snd_component

Add check for the return value of devm_kmemdup() to prevent
potential null pointer dereference.

Fixes: 756117701779 ("ASoC: codecs: Add FourSemi FS2104/5S audio amplifier driver")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Message-ID: <20250905091845.1559-1-hanchunchao@inspur.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Han and committed by
Mark Brown
be585f7e 554f6006

+3
+3
sound/soc/codecs/fs210x.c
··· 1458 1458 dai_drv->name = devm_kasprintf(fs210x->dev, 1459 1459 GFP_KERNEL, "%s-%d", 1460 1460 dai_drv->name, instance_id); 1461 + if (!dai_drv->name) 1462 + return -ENOMEM; 1463 + 1461 1464 instance_id++; 1462 1465 1463 1466 if (fs210x->devid == FS2105S_DEVICE_ID) {