From b18aaa1c7cd53ff654d3872ad58ab95343bbe476 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 9 May 2011 08:51:29 -0700 Subject: [PATCH] staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof(*ptr) Found via coccinelle script @@ type T; T* ptr; expression E1; @@ * memset(E1, 0, sizeof(ptr)); Signed-off-by: Joe Perches Acked-by: Roland Vossen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/brcmfmac/wl_iw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index a16b46c33d71..4b810eda9286 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,