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 <[email protected]> Reviewed-by: Amadeusz Sławiński <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent a9ec921 commit d20df86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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)