From: "Roland Vossen" <rvossen@broadcom.com>
To: "Joe Perches" <joe@perches.com>
Cc: "Brett Rudley" <brudley@broadcom.com>,
"Arend Van Spriel" <arend@broadcom.com>,
"Greg Kroah-Hartman" <gregkh@suse.de>,
devel <devel@driverdev.osuosl.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr)
Date: Tue, 10 May 2011 12:07:01 +0200 [thread overview]
Message-ID: <4DC90E45.2010703@broadcom.com> (raw)
In-Reply-To: <1304956289.19586.35.camel@Joe-Laptop>
Nice catch!
Acked-by: Roland Vossen <rvossen@broadcom.com>
On 05/09/2011 05:51 PM, Joe Perches wrote:
> Found via coccinelle script
>
> @@
> type T;
> T* ptr;
> expression E1;
> @@
>
> * memset(E1, 0, sizeof(ptr));
>
> Signed-off-by: Joe Perches<joe@perches.com>
> ---
> drivers/staging/brcm80211/brcmfmac/wl_iw.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
> index a16b46c..4b810ed 100644
> --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
> +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
> @@ -498,9 +498,7 @@ wl_iw_get_range(struct net_device *dev,
> list = (wl_u32_list_t *) channels;
>
> dwrq->length = sizeof(struct iw_range);
> - memset(range, 0, sizeof(range));
> -
> - range->min_nwid = range->max_nwid = 0;
> + memset(range, 0, sizeof(*range));
>
> list->count = cpu_to_le32(MAXCHANNEL);
> error = dev_wlc_ioctl(dev, WLC_GET_VALID_CHANNELS, channels,
>
>
>
prev parent reply other threads:[~2011-05-10 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 15:51 [PATCH] staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr) Joe Perches
2011-05-10 10:07 ` Roland Vossen [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=4DC90E45.2010703@broadcom.com \
--to=rvossen@broadcom.com \
--cc=arend@broadcom.com \
--cc=brudley@broadcom.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=joe@perches.com \
--cc=linux-wireless@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 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.