mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 06:55:07 +07:00
ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
Make sure devm_kzalloc() succeeds. Signed-off-by: Vishal Thanki <vishalthanki@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c517d838eb
commit
0004defd4e
@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
|
||||
strlen(dai_link->cpu_dai_name) +
|
||||
strlen(dai_link->codec_dai_name) + 2,
|
||||
GFP_KERNEL);
|
||||
if (!name) {
|
||||
ret = -ENOMEM;
|
||||
goto dai_link_of_err;
|
||||
}
|
||||
|
||||
sprintf(name, "%s-%s", dai_link->cpu_dai_name,
|
||||
dai_link->codec_dai_name);
|
||||
dai_link->name = dai_link->stream_name = name;
|
||||
|
Loading…
Reference in New Issue
Block a user