Skip to content

Commit 4814a8e

Browse files
morimotobroonie
authored andcommitted
ASoC: fsl: don't set link->platform if not needed
imx_card_parse_of() allocs 2 components for CPU/Platform (A) static int imx_card_parse_of(...) { ... for_each_child_of_node(...) { dlc = devm_kzalloc(...); ... link->cpus = &dlc[0]; (A) link->platforms = &dlc[1]; } ... } The link might be used as DPCM backend, in such case, link->plaforms will be not used. The driver overwrite it as Dummy DAI (B). } else if (!strncmp(link->name, "HiFi-ASRC-BE", 12)) { /* DPCM backend */ link->no_pcm = 1; link->platforms->of_node = NULL; (B) link->platforms->name = "snd-soc-dummy"; } If it was not used for generic DMAEngine, we can just remove it. By this patch, created dlc (A) will be just wasted, but it won't leak. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87cydfr1z6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cce73cf commit 4814a8e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sound/soc/fsl/imx-card.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,9 +670,12 @@ static int imx_card_parse_of(struct imx_card_data *data)
670670
}
671671
} else if (!strncmp(link->name, "HiFi-ASRC-BE", 12)) {
672672
/* DPCM backend */
673+
/*
674+
* No need to have link->platforms. alloced dlc[1] will be just wasted,
675+
* but it won't leak.
676+
*/
673677
link->no_pcm = 1;
674-
link->platforms->of_node = NULL;
675-
link->platforms->name = "snd-soc-dummy";
678+
link->platforms = NULL;
676679

677680
link->be_hw_params_fixup = be_hw_params_fixup;
678681
link->ops = &imx_aif_ops_be;

0 commit comments

Comments
 (0)