alsa: correct kcalloc usage
Subsystems (4)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 alsa: correct kcalloc usage
kcalloc is supposed to be called with the count as its first argument and the element size as the second.
---
Both arguments are size_t so does not affect correctness. This callsite is during module_init and therefore not performance critical. Another patch will optimize the case when the count is variable but the size is fixed.
alsa-devel on bcc due to (subscribers-only)
sound/pci/nm256/nm256.c +2 -2
@@ -1302,8 +1302,8 @@ snd_nm256_mixer(struct nm256 *chip) .read = snd_nm256_ac97_read, }; - chip->ac97_regs =kcalloc (sizeof (short ), -ARRAY_SIZE (nm256_ac97_init_val),GFP_KERNEL ); + chip->ac97_regs =kcalloc (ARRAY_SIZE (nm256_ac97_init_val), +sizeof (short ),GFP_KERNEL );if (! chip->ac97_regs)return -ENOMEM ;
PATCH 1/1 tcp: correct kcalloc usage
In reply to a message not in the archivekcalloc is supposed to be called with the count as its first argument and the element size as the second.
---
Both arguments are size_t so does not affect correctness. This callsite is during module_init and therefore not performance critical. Another patch will optimize the case when the count is variable but the size is fixed.
net/ipv4/tcp_probe.c +1 -1
@@ -224,7 +224,7 @@ static __init int tcpprobe_init(void)if (bufsize <0 )return -EINVAL ; - tcp_probe.log =kcalloc (sizeof (struct tcp_log ), bufsize,GFP_KERNEL ); + tcp_probe.log =kcalloc (bufsize,sizeof (struct tcp_log ),GFP_KERNEL );if (!tcp_probe.log) goto err0;
Re: [PATCH] tcp: correct kcalloc usage
From: Milton Miller <[email protected]>
Date: Thu, 10 Jul 2008 16:25:33 -0500 (CDT)
Quoted 4 lines
kcalloc is supposed to be called with the count as its first argument and the element size as the second.
Signed-off-by Milton Miller <[email protected]>
Applied, thanks!