[PATCH] ipw2200: replace kmalloc+memset with kcalloc
Replace kmalloc+memset with kcalloc Signed-off-by: Yan Burman <burman.yan@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
b950e83b69
commit
e6e3f12ad7
1 changed files with 1 additions and 2 deletions
|
@ -11129,14 +11129,13 @@ static int ipw_up(struct ipw_priv *priv)
|
|||
return -EIO;
|
||||
|
||||
if (cmdlog && !priv->cmdlog) {
|
||||
priv->cmdlog = kmalloc(sizeof(*priv->cmdlog) * cmdlog,
|
||||
priv->cmdlog = kcalloc(cmdlog, sizeof(*priv->cmdlog),
|
||||
GFP_KERNEL);
|
||||
if (priv->cmdlog == NULL) {
|
||||
IPW_ERROR("Error allocating %d command log entries.\n",
|
||||
cmdlog);
|
||||
return -ENOMEM;
|
||||
} else {
|
||||
memset(priv->cmdlog, 0, sizeof(*priv->cmdlog) * cmdlog);
|
||||
priv->cmdlog_len = cmdlog;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue