[PATCH] ipw2200: replace kmalloc+memset with kcalloc
authorYan Burman <burman.yan@gmail.com>
Sat, 2 Dec 2006 11:38:14 +0000 (13:38 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Dec 2006 00:31:32 +0000 (19:31 -0500)
Replace kmalloc+memset with kcalloc

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ipw2200.c

index c692d01a76ca528c8830b9ba30c392769b76eb0b..b2e144b7f4a0a2dc1ae2c1c5dd71d1b7eead5017 100644 (file)
@@ -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;
                }
        }