Unverified Commit 15247b5a authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown
Browse files

ASoC: SDCA: Update memory allocations to zero initialise



All the memory allocations in the SDCA ASoC helpers rely on fields being
zero initialised, the code should use kzalloc not kmalloc.

Reported-by: default avatarShuming Fan <shumingf@realtek.com>
Fixes: 2c8b3a8e ("ASoC: SDCA: Create DAPM widgets and routes from DisCo")
Fixes: c3ca24e3 ("ASoC: SDCA: Create ALSA controls from DisCo")
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250715151723.2964336-4-ckeepax@opensource.cirrus.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 71562278
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -230,11 +230,11 @@ static int entity_early_parse_ge(struct device *dev,
	if (!control_name)
		return -ENOMEM;

	kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
	kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
	if (!kctl)
		return -ENOMEM;

	soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
	soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
	if (!soc_enum)
		return -ENOMEM;

@@ -561,11 +561,11 @@ static int entity_parse_su_class(struct device *dev,
	const char **texts;
	int i;

	kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
	kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
	if (!kctl)
		return -ENOMEM;

	soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
	soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
	if (!soc_enum)
		return -ENOMEM;

@@ -672,7 +672,7 @@ static int entity_parse_mu(struct device *dev,
		if (!control_name)
			return -ENOMEM;

		mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
		mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
		if (!mc)
			return -ENOMEM;

@@ -926,7 +926,7 @@ static int populate_control(struct device *dev,
	if (!control_name)
		return -ENOMEM;

	mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
	mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
	if (!mc)
		return -ENOMEM;