Skip to content

Commit 15247b5

Browse files
charleskeepaxbroonie
authored andcommitted
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 <[email protected]> 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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7156227 commit 15247b5

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
@@ -230,11 +230,11 @@ static int entity_early_parse_ge(struct device *dev,
230230
if (!control_name)
231231
return -ENOMEM;
232232

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

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

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

564-
kctl = devm_kmalloc(dev, sizeof(*kctl), GFP_KERNEL);
564+
kctl = devm_kzalloc(dev, sizeof(*kctl), GFP_KERNEL);
565565
if (!kctl)
566566
return -ENOMEM;
567567

568-
soc_enum = devm_kmalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
568+
soc_enum = devm_kzalloc(dev, sizeof(*soc_enum), GFP_KERNEL);
569569
if (!soc_enum)
570570
return -ENOMEM;
571571

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

675-
mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
675+
mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
676676
if (!mc)
677677
return -ENOMEM;
678678

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

929-
mc = devm_kmalloc(dev, sizeof(*mc), GFP_KERNEL);
929+
mc = devm_kzalloc(dev, sizeof(*mc), GFP_KERNEL);
930930
if (!mc)
931931
return -ENOMEM;
932932

0 commit comments

Comments
 (0)