]> err.no Git - linux-2.6/commitdiff
ALSA: correct kcalloc usage
authorMilton Miller <miltonm@bga.com>
Sun, 13 Jul 2008 11:58:12 +0000 (13:58 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 14 Jul 2008 07:01:09 +0000 (09:01 +0200)
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>
sound/pci/nm256/nm256.c

index 7efb838d18a6b3e78c0b5ceedeccc85887187b2c..06d13e7171148d261fdeeccd21563da3ef59d577 100644 (file)
@@ -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;