* [PATCH] staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr)
@ 2011-05-09 15:51 Joe Perches
2011-05-10 10:07 ` Roland Vossen
0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2011-05-09 15:51 UTC (permalink / raw)
To: Brett Rudley, Arend van Spriel, Roland Vossen
Cc: Greg Kroah-Hartman, devel, linux-wireless
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,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr)
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
0 siblings, 0 replies; 2+ messages in thread
From: Roland Vossen @ 2011-05-10 10:07 UTC (permalink / raw)
To: Joe Perches
Cc: Brett Rudley, Arend Van Spriel, Greg Kroah-Hartman, devel,
linux-wireless@vger.kernel.org
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,
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-10 10:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).