[PATCH 2.6.19] ipw2200: replace kmalloc+memset with kcalloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace kmalloc+memset with kcalloc

Signed-off-by: Yan Burman <[email protected]>

diff -rubp linux-2.6.19-rc5_orig/drivers/net/wireless/ipw2200.c linux-2.6.19-rc5_kzalloc/drivers/net/wireless/ipw2200.c
--- linux-2.6.19-rc5_orig/drivers/net/wireless/ipw2200.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/net/wireless/ipw2200.c	2006-11-11 22:44:04.000000000 +0200
@@ -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;
 		}
 	}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux