* [PATCH] brcmsmac: Replace kmalloc/memset with kzalloc
@ 2011-12-15 2:23 Larry Finger
2011-12-15 11:45 ` Arend van Spriel
0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2011-12-15 2:23 UTC (permalink / raw)
To: John W Linville; +Cc: frankyl, arend, linux-wireless
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>
---
John,
This is 3.3 material.
Larry
---
Index: wireless-testing-new/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ wireless-testing-new/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -565,8 +565,6 @@ static struct si_info *ai_doattach(struc
struct bcma_device *cc;
uint socitype;
- memset((unsigned char *) sii, 0, sizeof(struct si_info));
-
savewin = 0;
sii->icbus = pbus;
@@ -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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-15 11:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15 2:23 [PATCH] brcmsmac: Replace kmalloc/memset with kzalloc Larry Finger
2011-12-15 11:45 ` Arend van Spriel
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).