提交 e6e3f12a 编写于 作者: Y Yan Burman 提交者: John W. Linville

[PATCH] ipw2200: replace kmalloc+memset with kcalloc

Replace kmalloc+memset with kcalloc
Signed-off-by: NYan Burman <burman.yan@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b950e83b
...@@ -11129,14 +11129,13 @@ static int ipw_up(struct ipw_priv *priv) ...@@ -11129,14 +11129,13 @@ static int ipw_up(struct ipw_priv *priv)
return -EIO; return -EIO;
if (cmdlog && !priv->cmdlog) { if (cmdlog && !priv->cmdlog) {
priv->cmdlog = kmalloc(sizeof(*priv->cmdlog) * cmdlog, priv->cmdlog = kcalloc(cmdlog, sizeof(*priv->cmdlog),
GFP_KERNEL); GFP_KERNEL);
if (priv->cmdlog == NULL) { if (priv->cmdlog == NULL) {
IPW_ERROR("Error allocating %d command log entries.\n", IPW_ERROR("Error allocating %d command log entries.\n",
cmdlog); cmdlog);
return -ENOMEM; return -ENOMEM;
} else { } else {
memset(priv->cmdlog, 0, sizeof(*priv->cmdlog) * cmdlog);
priv->cmdlog_len = cmdlog; priv->cmdlog_len = cmdlog;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册