diff options
| author | Charles Han <hanchunchao@inspur.com> | 2025-09-05 12:18:44 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-09-05 13:57:51 +0300 |
| commit | be585f7ebc99598edf97c3001d0f8d67954ab376 (patch) | |
| tree | 957901fe666dc0c2d14113e91dbc0f12d55ec418 | |
| parent | 554f6006c3c050026a0a505dfedfe03407e267e1 (diff) | |
| download | linux-be585f7ebc99598edf97c3001d0f8d67954ab376.tar.xz | |
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>
| -rw-r--r-- | sound/soc/codecs/fs210x.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/fs210x.c b/sound/soc/codecs/fs210x.c index b4f51ee7235a..e2f85714972d 100644 --- a/sound/soc/codecs/fs210x.c +++ b/sound/soc/codecs/fs210x.c @@ -1458,6 +1458,9 @@ static int fs210x_register_snd_component(struct fs210x_priv *fs210x) dai_drv->name = devm_kasprintf(fs210x->dev, GFP_KERNEL, "%s-%d", dai_drv->name, instance_id); + if (!dai_drv->name) + return -ENOMEM; + instance_id++; if (fs210x->devid == FS2105S_DEVICE_ID) { |
