Unverified Commit 36a9d79e authored by Samuel Holland's avatar Samuel Holland Committed by Mark Brown
Browse files

ASoC: simple-card-utils: Avoid over-allocating DLCs



The allocation of the DAI link components (DLCs) passed the wrong
pointer to sizeof. Since simple_dai_props is much larger than
snd_soc_dai_link_component, there was no out of bounds access, only
wasted memory.

Fixes: f2138aed ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
Fixes: 050c7950 ("ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform")
Reviewed-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20210805050706.46833-1-samuel@sholland.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f2553d46
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -641,7 +641,7 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
	}

	dais = devm_kcalloc(dev, dai_num, sizeof(*dais), GFP_KERNEL);
	dlcs = devm_kcalloc(dev, dlc_num, sizeof(*dai_props), GFP_KERNEL);
	dlcs = devm_kcalloc(dev, dlc_num, sizeof(*dlcs), GFP_KERNEL);
	if (!dais || !dlcs)
		return -ENOMEM;