* [PATCH] slip: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls
@ 2007-01-16 6:42 joe jin
0 siblings, 0 replies; only message in thread
From: joe jin @ 2007-01-16 6:42 UTC (permalink / raw)
To: linux-kernel, Andrew Morton; +Cc: joe.jin
This patch replace kmalloc() + memset() pairs with the appropriate
kzalloc().
Signed-off-by: Joe Jin <joe.jin@oracle.com>
--- drivers/net/slip.c.orig 2007-01-16 14:21:52.000000000 +0800
+++ drivers/net/slip.c 2007-01-16 14:23:07.000000000 +0800
@@ -1343,15 +1343,12 @@
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-01-16 6:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 6:42 [PATCH] slip: Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls joe jin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®