Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[sfrench/cifs-2.6.git] / arch / alpha / kernel / pci-noop.c
index 091cff3c68fd47cfa860761eade0587b8df43408..ae82061edae995dc1ee2d9f711c9a1e604915849 100644 (file)
@@ -34,6 +34,9 @@ alloc_pci_controller(void)
        struct pci_controller *hose;
 
        hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES);
+       if (!hose)
+               panic("%s: Failed to allocate %zu bytes\n", __func__,
+                     sizeof(*hose));
 
        *hose_tail = hose;
        hose_tail = &hose->next;
@@ -44,7 +47,13 @@ alloc_pci_controller(void)
 struct resource * __init
 alloc_resource(void)
 {
-       return memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
+       void *ptr = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
+
+       if (!ptr)
+               panic("%s: Failed to allocate %zu bytes\n", __func__,
+                     sizeof(struct resource));
+
+       return ptr;
 }
 
 SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus,
@@ -54,7 +63,7 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus,
 
        /* from hose or from bus.devfn */
        if (which & IOBASE_FROM_HOSE) {
-               for (hose = hose_head; hose; hose = hose->next) 
+               for (hose = hose_head; hose; hose = hose->next)
                        if (hose->index == bus)
                                break;
                if (!hose)