From: Joe Jin Date: Tue, 6 Feb 2007 02:08:47 +0000 (-0800) Subject: [NET] slip: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls X-Git-Tag: v2.6.21-rc1~83^2~65^2~48 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=919afbd68863550665b328a78107bc2919c5e3f4;p=linux-2.6 [NET] slip: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls This patch replace kmalloc() + memset() pairs with the appropriate kzalloc(). Signed-off-by: Joe Jin Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- diff --git a/drivers/net/slip.c b/drivers/net/slip.c index a0806d262f..2f4b1de7a2 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -1343,15 +1343,12 @@ static int __init slip_init(void) printk(KERN_INFO "SLIP linefill/keepalive option.\n"); #endif - slip_devs = kmalloc(sizeof(struct net_device *)*slip_maxdev, GFP_KERNEL); + slip_devs = kzalloc(sizeof(struct net_device *)*slip_maxdev, GFP_KERNEL); if (!slip_devs) { printk(KERN_ERR "SLIP: Can't allocate slip devices array! Uaargh! (-> No SLIP available)\n"); return -ENOMEM; } - /* Clear the pointer array, we allocate devices when we need them */ - memset(slip_devs, 0, sizeof(struct net_device *)*slip_maxdev); - /* Fill in our line protocol discipline, and register it */ if ((status = tty_register_ldisc(N_SLIP, &sl_ldisc)) != 0) { printk(KERN_ERR "SLIP: can't register line discipline (err = %d)\n", status);