From: Luciano Coelho <luciano.coelho@nokia.com>
To: ext Joe Perches <joe@perches.com>
Cc: netdev <netdev@vger.kernel.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc
Date: Thu, 12 Aug 2010 09:48:14 +0300 [thread overview]
Message-ID: <1281595694.4440.2.camel@powerslave> (raw)
In-Reply-To: <1281546168.3976.39.camel@Joe-Laptop.home>
On Wed, 2010-08-11 at 19:02 +0200, ext Joe Perches wrote:
> These changes may be slightly safer in some instances.
>
> There are other kzalloc calls with a multiply, but those
> calls are typically "small fixed #" * sizeof(some pointer)"
> and those are not converted.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
[...]
> drivers/net/wireless/wl12xx/wl1271_scan.c | 2 +-
[...]
> diff --git a/drivers/net/wireless/wl12xx/wl1271_scan.c b/drivers/net/wireless/wl12xx/wl1271_scan.c
> index fec43ee..30dc100 100644
> --- a/drivers/net/wireless/wl12xx/wl1271_scan.c
> +++ b/drivers/net/wireless/wl12xx/wl1271_scan.c
> @@ -248,7 +248,7 @@ int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len,
>
> wl->scan.req = req;
>
> - wl->scan.scanned_ch = kzalloc(req->n_channels *
> + wl->scan.scanned_ch = kcalloc(req->n_channels,
> sizeof(*wl->scan.scanned_ch),
> GFP_KERNEL);
> wl1271_scan_stm(wl);
For the wl1271 part:
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
--
Cheers,
Luca.
prev parent reply other threads:[~2010-08-12 6:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 17:02 [PATCH (for some future time)] drivers/net: Convert unbounded kzalloc calls to kcalloc Joe Perches
2010-08-11 18:40 ` Gertjan van Wingerde
2010-08-12 6:48 ` Luciano Coelho [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=1281595694.4440.2.camel@powerslave \
--to=luciano.coelho@nokia.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).