mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
ALSA: ctxfi: change dao_set_input functions from kzalloc to kcalloc
We are trying to get rid of all multiplications from allocation functions to prevent potential integer overflows. Here the multiplication is probably safe, but using kcalloc() is more appropriate and improves readability. This patch has no effect on runtime behavior. Link: https://github.com/KSPP/linux/issues/162 [1] Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com> Link: https://patch.msgid.link/20250308-ctdaio-kzalloc-v1-1-804a09875b0e@ethancedwards.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
ef749c8d95
commit
520a563b9a
|
|
@ -159,7 +159,7 @@ static int dao_set_left_input(struct dao *dao, struct rsc *input)
|
|||
struct daio *daio = &dao->daio;
|
||||
int i;
|
||||
|
||||
entry = kzalloc((sizeof(*entry) * daio->rscl.msr), GFP_KERNEL);
|
||||
entry = kcalloc(daio->rscl.msr, sizeof(*entry), GFP_KERNEL);
|
||||
if (!entry)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ static int dao_set_right_input(struct dao *dao, struct rsc *input)
|
|||
struct daio *daio = &dao->daio;
|
||||
int i;
|
||||
|
||||
entry = kzalloc((sizeof(*entry) * daio->rscr.msr), GFP_KERNEL);
|
||||
entry = kcalloc(daio->rscr.msr, sizeof(*entry), GFP_KERNEL);
|
||||
if (!entry)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user