提交 00d2ec0c 编写于 作者: L Larry Finger 提交者: John W. Linville

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: NLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 55e435de
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册