From 00d2ec0c5f5ae8507931efd8feb174f30370c12e Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 14 Dec 2011 20:23:03 -0600 Subject: [PATCH] brcmsmac: Replace kmalloc/memset with kzalloc 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 Acked-by: Arend van Spriel Signed-off-by: John W. Linville --- drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c index 372bee8dd926..ab9bb11abfbb 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c @@ -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; -- 2.39.5