]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
brcmsmac: Replace kmalloc/memset with kzalloc
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 15 Dec 2011 02:23:03 +0000 (20:23 -0600)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 15 Dec 2011 19:46:37 +0000 (14:46 -0500)
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>
drivers/net/wireless/brcm80211/brcmsmac/aiutils.c

index 372bee8dd926b7b6cd914e664b684e31c94b886c..ab9bb11abfbb2b26f0bf3a440030a26734099887 100644 (file)
@@ -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;
@@ -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;