From: Dan Carpenter <dan.carpenter@oracle.com>
To: thomas@net.t-labs.tu-berlin.de
Cc: linux-wireless@vger.kernel.org
Subject: re: mac80211: correct size the argument to kzalloc in
Date: Mon, 2 Jul 2012 14:59:07 +0300 [thread overview]
Message-ID: <20120702115907.GA28105@elgon.mountain> (raw)
minstrel_ht
Hello Thomas Huehn,
The patch 0a08adeb773c: "mac80211: correct size the argument to
kzalloc in minstrel_ht" from Jun 29, 2012, leads to the following
Sparse warning:
net/mac80211/rc80211_minstrel_ht.c:816:33:
warning: expression using sizeof(void)
- msp->ratelist = kzalloc(sizeof(struct minstrel_rate) * max_rates, gfp);
+ msp->ratelist = kzalloc(sizeof(*msp->ratelist) * max_rates, gfp);
if (!msp->ratelist)
goto error;
"msp->ratelist" is a void pointer so that will cause memory corruption.
You could consider making it a struct minstrel_rate pointer. I haven't
looked at this.
regards,
dan carpenter
next reply other threads:[~2012-07-02 11:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 11:59 Dan Carpenter [this message]
[not found] ` <4FF18E57.7040704@net.t-labs.tu-berlin.de>
2012-07-02 12:26 ` mac80211: correct size the argument to kzalloc in Dan Carpenter
2012-07-02 12:41 ` Thomas Huehn
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=20120702115907.GA28105@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=linux-wireless@vger.kernel.org \
--cc=thomas@net.t-labs.tu-berlin.de \
/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.