mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kzalloc: use in alloc_netdev
@ 2006-04-07  5:32 Paolo 'Blaisorblade' Giarrusso
  2006-04-07  5:38 ` David S. Miller
  2006-04-07  5:52 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo 'Blaisorblade' Giarrusso @ 2006-04-07  5:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Noticed this use, fixed it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 net/core/dev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 434220d..dfb6299 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3100,12 +3100,11 @@ struct net_device *alloc_netdev(int size
 	alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST;
 	alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;
 
-	p = kmalloc(alloc_size, GFP_KERNEL);
+	p = kzalloc(alloc_size, GFP_KERNEL);
 	if (!p) {
 		printk(KERN_ERR "alloc_dev: Unable to allocate device.\n");
 		return NULL;
 	}
-	memset(p, 0, alloc_size);
 
 	dev = (struct net_device *)
 		(((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-07 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-07  5:32 [PATCH] kzalloc: use in alloc_netdev Paolo 'Blaisorblade' Giarrusso
2006-04-07  5:38 ` David S. Miller
2006-04-07  5:52 ` Andrew Morton
2006-04-07 21:53   ` David S. Miller

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®