From: Milton Miller <miltonm@bga.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.org
Subject: [PATCH] alsa: correct kcalloc usage
Date: Thu, 10 Jul 2008 16:28:48 -0500 (CDT) [thread overview]
Message-ID: <for-27-patch8-3@bga.com> (raw)
In-Reply-To: <for-27-patch8-1@bga.com>
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 <miltonm@bga.com>
---
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)
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 7efb838..06d13e7 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -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;
prev parent reply other threads:[~2008-07-10 21:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <for-27-patch8-1@bga.com>
2008-07-10 21:25 ` [PATCH] tcp: correct kcalloc usage Milton Miller
2008-07-10 23:51 ` David Miller
2008-07-10 21:28 ` Milton Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=for-27-patch8-3@bga.com \
--to=miltonm@bga.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.org \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.