aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2011-05-10 15:29:24 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 01:30:57 -0400
commita56555e573d3740d588d912aada506d57759cf5d (patch)
tree1f1c44ec8f60cc68f6fd79e3c6c54db2aee02c4c /arch/powerpc/platforms
parent7ca8aa0924712de81485c70e00bbea8c092a08c1 (diff)
powerpc: Remove alloc_maybe_bootmem for zalloc version
Replace all remaining callers of alloc_maybe_bootmem with zalloc_maybe_bootmem. The callsite in pci_dn is followed with a memset to clear the memory, and not zeroing at the other callsites in the celleb fake pci code could lead to following uninitialized memory as pointers or even freeing said pointers on error paths. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/celleb_pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index 2904b0a6b2c5..5822141aa63f 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -319,7 +319,7 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node,
319 319
320 size = 256; 320 size = 256;
321 config = &private->fake_config[devno][fn]; 321 config = &private->fake_config[devno][fn];
322 *config = alloc_maybe_bootmem(size, GFP_KERNEL); 322 *config = zalloc_maybe_bootmem(size, GFP_KERNEL);
323 if (*config == NULL) { 323 if (*config == NULL) {
324 printk(KERN_ERR "PCI: " 324 printk(KERN_ERR "PCI: "
325 "not enough memory for fake configuration space\n"); 325 "not enough memory for fake configuration space\n");
@@ -330,7 +330,7 @@ static int __init celleb_setup_fake_pci_device(struct device_node *node,
330 330
331 size = sizeof(struct celleb_pci_resource); 331 size = sizeof(struct celleb_pci_resource);
332 res = &private->res[devno][fn]; 332 res = &private->res[devno][fn];
333 *res = alloc_maybe_bootmem(size, GFP_KERNEL); 333 *res = zalloc_maybe_bootmem(size, GFP_KERNEL);
334 if (*res == NULL) { 334 if (*res == NULL) {
335 printk(KERN_ERR 335 printk(KERN_ERR
336 "PCI: not enough memory for resource data space\n"); 336 "PCI: not enough memory for resource data space\n");
@@ -431,7 +431,7 @@ static int __init phb_set_bus_ranges(struct device_node *dev,
431static void __init celleb_alloc_private_mem(struct pci_controller *hose) 431static void __init celleb_alloc_private_mem(struct pci_controller *hose)
432{ 432{
433 hose->private_data = 433 hose->private_data =
434 alloc_maybe_bootmem(sizeof(struct celleb_pci_private), 434 zalloc_maybe_bootmem(sizeof(struct celleb_pci_private),
435 GFP_KERNEL); 435 GFP_KERNEL);
436} 436}
437 437