Skip to content

Commit

Permalink
ALSA: correct kcalloc usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Milton Miller authored and Jaroslav Kysela committed Jul 14, 2008
1 parent 862c2c0 commit 80ca9a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/pci/nm256/nm256.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 80ca9a7

Please sign in to comment.