]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/ia64/sn/pci/pcibr/pcibr_provider.c
[IA64-SGI] sn2 minor fixes and cleanups
[net-next-2.6.git] / arch / ia64 / sn / pci / pcibr / pcibr_provider.c
index 2fac27049bf62eda7323fee737217db830250fc8..98f716bd92f0ce414d414f8c1c6cf68523d01f7f 100644 (file)
@@ -163,9 +163,12 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
        /* Setup the PMU ATE map */
        soft->pbi_int_ate_resource.lowest_free_index = 0;
        soft->pbi_int_ate_resource.ate =
-           kmalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
-       memset(soft->pbi_int_ate_resource.ate, 0,
-              (soft->pbi_int_ate_size * sizeof(u64)));
+           kzalloc(soft->pbi_int_ate_size * sizeof(u64), GFP_KERNEL);
+
+       if (!soft->pbi_int_ate_resource.ate) {
+               kfree(soft);
+               return NULL;
+       }
 
        if (prom_bussoft->bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
                /* TIO PCI Bridge: find nearest node with CPUs */