All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci: Use kzalloc() in pci_create_bus()
@ 2009-03-15 19:14 Geert Uytterhoeven
  2009-03-20  1:43 ` Jesse Barnes
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2009-03-15 19:14 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Linux Kernel Development, linux-pci

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
1. Untested ;-)
2. Probably none of the static analyzers noticed, because of the amount of
   code in between the kmalloc() and the memset()

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 55ec44a..fa0999f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1114,7 +1114,7 @@ struct pci_bus * pci_create_bus(struct device *parent,
 	if (!b)
 		return NULL;
 
-	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (!dev){
 		kfree(b);
 		return NULL;
@@ -1133,7 +1133,6 @@ struct pci_bus * pci_create_bus(struct device *parent,
 	list_add_tail(&b->node, &pci_root_buses);
 	up_write(&pci_bus_sem);
 
-	memset(dev, 0, sizeof(*dev));
 	dev->parent = parent;
 	dev->release = pci_release_bus_bridge_dev;
 	dev_set_name(dev, "pci%04x:%02x", pci_domain_nr(b), bus);

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] pci: Use kzalloc() in pci_create_bus()
  2009-03-15 19:14 [PATCH] pci: Use kzalloc() in pci_create_bus() Geert Uytterhoeven
@ 2009-03-20  1:43 ` Jesse Barnes
  0 siblings, 0 replies; 2+ messages in thread
From: Jesse Barnes @ 2009-03-20  1:43 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux Kernel Development, linux-pci

On Sun, 15 Mar 2009 20:14:37 +0100 (CET)
Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center

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

end of thread, other threads:[~2009-03-20  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-15 19:14 [PATCH] pci: Use kzalloc() in pci_create_bus() Geert Uytterhoeven
2009-03-20  1:43 ` Jesse Barnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.