Skip to content

Commit

Permalink
staging: brcm80211: brcmfmac: Fix memset using sizeof(ptr) not sizeof…
Browse files Browse the repository at this point in the history
…(*ptr)

Found via coccinelle script

@@
type T;
T* ptr;
expression E1;
@@

* memset(E1, 0, sizeof(ptr));

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed May 10, 2011
1 parent c4295d7 commit b18aaa1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/brcm80211/brcmfmac/wl_iw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b18aaa1

Please sign in to comment.