Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80ca9a70 authored by Milton Miller's avatar Milton Miller Committed by Jaroslav Kysela
Browse files

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: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 862c2c0a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;