diff --git a/sound/soc/tegra-alt/utils/tegra_asoc_machine_alt.c b/sound/soc/tegra-alt/utils/tegra_asoc_machine_alt.c index d8dcde06..feb75221 100644 --- a/sound/soc/tegra-alt/utils/tegra_asoc_machine_alt.c +++ b/sound/soc/tegra-alt/utils/tegra_asoc_machine_alt.c @@ -2915,6 +2915,9 @@ struct snd_soc_dai_link *tegra_machine_get_dai_link(void) tegra_asoc_machine_links = kzalloc(size * sizeof(struct snd_soc_dai_link), GFP_KERNEL); + if (!tegra_asoc_machine_links) + return NULL; + memcpy(tegra_asoc_machine_links, link, size * sizeof(struct snd_soc_dai_link)); @@ -3024,6 +3027,9 @@ struct snd_soc_codec_conf *tegra_machine_get_codec_conf(void) tegra_asoc_codec_conf = kzalloc(size * sizeof(struct snd_soc_codec_conf), GFP_KERNEL); + if (!tegra_asoc_codec_conf) + return NULL; + memcpy(tegra_asoc_codec_conf, conf, size * sizeof(struct snd_soc_codec_conf)); @@ -3446,6 +3452,9 @@ struct snd_soc_dai_link *tegra_machine_get_dai_link_t18x(void) tegra_asoc_machine_links_t18x = kzalloc(size * sizeof(struct snd_soc_dai_link), GFP_KERNEL); + if (!tegra_asoc_machine_links_t18x) + return NULL; + memcpy(tegra_asoc_machine_links_t18x, link, size * sizeof(struct snd_soc_dai_link)); @@ -3504,6 +3513,9 @@ struct snd_soc_codec_conf *tegra_machine_get_codec_conf_t18x(void) tegra_asoc_codec_conf_t18x = kzalloc(size * sizeof(struct snd_soc_codec_conf), GFP_KERNEL); + if (!tegra_asoc_codec_conf_t18x) + return NULL; + memcpy(tegra_asoc_codec_conf_t18x, conf, size * sizeof(struct snd_soc_codec_conf));