aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2008-07-13 07:58:12 -0400
committerJaroslav Kysela <perex@perex.cz>2008-07-14 03:01:09 -0400
commit80ca9a706b458d09b8cc8d5258bb61957f66ca5e (patch)
treeb8b0f6c2736f89b4dc5a45a834aaa0099b07aa90 /sound/pci
parent862c2c0a61c515f2e9f63f689215bcf99a607eaf (diff)
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. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/nm256/nm256.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 7efb838d18a6..06d13e717114 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1302,8 +1302,8 @@ snd_nm256_mixer(struct nm256 *chip)
1302 .read = snd_nm256_ac97_read, 1302 .read = snd_nm256_ac97_read,
1303 }; 1303 };
1304 1304
1305 chip->ac97_regs = kcalloc(sizeof(short), 1305 chip->ac97_regs = kcalloc(ARRAY_SIZE(nm256_ac97_init_val),
1306 ARRAY_SIZE(nm256_ac97_init_val), GFP_KERNEL); 1306 sizeof(short), GFP_KERNEL);
1307 if (! chip->ac97_regs) 1307 if (! chip->ac97_regs)
1308 return -ENOMEM; 1308 return -ENOMEM;
1309 1309