Skip to content

Commit

Permalink
brcmsmac: Replace kmalloc/memset with kzalloc
Browse files Browse the repository at this point in the history
In ai_attach(), space is allocated for an si_info struct. Immediately
after the allocation, routine ai_doattach() is called and that allocated
space is set to zero. As no other routine calls ai_doattach(), kzalloc()
can be utilized.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Larry Finger authored and John W. Linville committed Dec 15, 2011
1 parent 55e435d commit 00d2ec0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ static struct si_info *ai_doattach(struct si_info *sii,
struct bcma_device *cc;
uint socitype;

memset((unsigned char *) sii, 0, sizeof(struct si_info));

savewin = 0;

sii->icbus = pbus;
Expand Down Expand Up @@ -677,7 +675,7 @@ ai_attach(struct bcma_bus *pbus)
struct si_info *sii;

/* alloc struct si_info */
sii = kmalloc(sizeof(struct si_info), GFP_ATOMIC);
sii = kzalloc(sizeof(struct si_info), GFP_ATOMIC);
if (sii == NULL)
return NULL;

Expand Down

0 comments on commit 00d2ec0

Please sign in to comment.