Skip to content

Commit d20df86

Browse files
tobluxbroonie
authored andcommitted
ASoC: Intel: avs: Fix kcalloc() sizes
rlist, clist, and slist are allocated using sizeof(pointer) instead of sizeof(*pointer). Fix the allocations by using sizeof(*pointer) and avoid overallocating memory on 64-bit systems. Fixes: f2f8474 ("ASoC: Intel: avs: Constrain path based on BE capabilities") Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://patch.msgid.link/20250426141342.94134-2-thorsten.blum@linux.dev Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a9ec921 commit d20df86

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sound/soc/intel/avs/path.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ int avs_path_set_constraint(struct avs_dev *adev, struct avs_tplg_path_template
131131
list_for_each_entry(path_template, &template->path_list, node)
132132
i++;
133133

134-
rlist = kcalloc(i, sizeof(rlist), GFP_KERNEL);
135-
clist = kcalloc(i, sizeof(clist), GFP_KERNEL);
136-
slist = kcalloc(i, sizeof(slist), GFP_KERNEL);
134+
rlist = kcalloc(i, sizeof(*rlist), GFP_KERNEL);
135+
clist = kcalloc(i, sizeof(*clist), GFP_KERNEL);
136+
slist = kcalloc(i, sizeof(*slist), GFP_KERNEL);
137137

138138
i = 0;
139139
list_for_each_entry(path_template, &template->path_list, node) {

0 commit comments

Comments
 (0)