Skip to content

Commit f72c953

Browse files
committed
ASoC: SDCA: Update memory allocations to zero initialise
JIRA: https://issues.redhat.com/browse/RHEL-101627 commit 15247b5 Author: Charles Keepax <ckeepax@opensource.cirrus.com> Date: Tue Jul 15 16:17:23 2025 +0100 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: Shuming Fan <shumingf@realtek.com> Fixes: 2c8b3a8 ("ASoC: SDCA: Create DAPM widgets and routes from DisCo") Fixes: c3ca24e ("ASoC: SDCA: Create ALSA controls from DisCo") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250715151723.2964336-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
1 parent 1f90cee commit f72c953

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sound/soc/sdca/sdca_asoc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ static int entity_early_parse_ge(struct device *dev,
229229
if (!control_name)
230230
return -ENOMEM;
231231

232-
kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
232+
kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
233233
if (!kctl)
234234
return -ENOMEM;
235235

236-
soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
236+
soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
237237
if (!soc_enum)
238238
return -ENOMEM;
239239

@@ -558,11 +558,11 @@ static int entity_parse_su_class(struct device *dev,
558558
const char **texts;
559559
int i;
560560

561-
kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
561+
kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
562562
if (!kctl)
563563
return -ENOMEM;
564564

565-
soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
565+
soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
566566
if (!soc_enum)
567567
return -ENOMEM;
568568

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

672-
mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
672+
mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
673673
if (!mc)
674674
return -ENOMEM;
675675

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

926-
mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
926+
mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
927927
if (!mc)
928928
return -ENOMEM;
929929

0 commit comments

Comments
 (0)