Search Linux Wireless

Re: [PATCH] staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nice catch!

Acked-by: Roland Vossen <rvossen@xxxxxxxxxxxx>

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@xxxxxxxxxxx>
---
  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,





--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux