From: "Arend van Spriel" <arend@broadcom.com>
To: "Joe Perches" <joe@perches.com>
Cc: "Tim Gardner" <tim.gardner@canonical.com>,
linux-kernel@vger.kernel.org,
"Brett Rudley" <brudley@broadcom.com>,
"Franky (Zhenhui) Lin" <frankyl@broadcom.com>,
"Hante Meuleman" <meuleman@broadcom.com>,
"John W. Linville" <linville@tuxdriver.com>,
"Seth Forshee" <seth.forshee@canonical.com>,
"Pieter-Paul Giesberts" <pieterpg@broadcom.com>,
"Hauke Mehrtens" <hauke@hauke-m.de>,
linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com,
netdev@vger.kernel.org
Subject: Re: [PATCH wireless-next] brcmsmac: avoid 512 byte stack variable
Date: Thu, 7 Feb 2013 21:23:25 +0100 [thread overview]
Message-ID: <51140D3D.9020100@broadcom.com> (raw)
In-Reply-To: <1360268386.27863.2.camel@joe-AO722>
On 02/07/2013 09:19 PM, Joe Perches wrote:
> On Thu, 2013-02-07 at 13:13 -0700, Tim Gardner wrote:
>> Dynamically allocate the probe response template which
>> avoids potential stack corruption. Observed with smatch:
>
> trivial:
>
>> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
> []
>> @@ -7408,9 +7408,16 @@ brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
> []
>> + prb_resp = kmalloc(BCN_TMPL_LEN, GFP_ATOMIC);
>> + if (!prb_resp) {
>> + wiphy_err(wlc->wiphy, "wl: %s: failed to alloc %u bytes\n",
>> + __func__, BCN_TMPL_LEN);
>
> Please remove the error message.
> alloc's don't need specific OOM messages.
>
> The mm subsystem already provides a standardized
> message with a dump_stack().
You beat me to the finish line :-)
Gr. AvS
next prev parent reply other threads:[~2013-02-07 20:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 20:13 [PATCH wireless-next] brcmsmac: avoid 512 byte stack variable Tim Gardner
2013-02-07 20:19 ` Joe Perches
2013-02-07 20:23 ` Arend van Spriel [this message]
2013-02-07 20:22 ` Arend van Spriel
2013-02-07 20:28 ` [PATCH wireless-next V2] " Tim Gardner
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=51140D3D.9020100@broadcom.com \
--to=arend@broadcom.com \
--cc=brcm80211-dev-list@broadcom.com \
--cc=brudley@broadcom.com \
--cc=frankyl@broadcom.com \
--cc=hauke@hauke-m.de \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=meuleman@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pieterpg@broadcom.com \
--cc=seth.forshee@canonical.com \
--cc=tim.gardner@canonical.com \
/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.