From: Christophe Lucas Subject: [KJ] [patch 2.6.13-rc1 18/23] parisc/kernel/pci-dma: Audit return code of create_proc_* Acked-by: Grant Grundler --- pci-dma.c | 30 ++++++++++++++++++++---------- 1 files changed, 20 insertions(+), 10 deletions(-) Index: quilt/arch/parisc/kernel/pci-dma.c =================================================================== --- quilt.orig/arch/parisc/kernel/pci-dma.c +++ quilt/arch/parisc/kernel/pci-dma.c @@ -333,18 +333,28 @@ pcxl_free_range(unsigned long vaddr, siz static int __init pcxl_dma_init(void) { - if (pcxl_dma_start == 0) - return 0; + if (pcxl_dma_start == 0) + return 0; - spin_lock_init(&pcxl_res_lock); - pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3); - pcxl_res_hint = 0; - pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL, + spin_lock_init(&pcxl_res_lock); + pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3); + pcxl_res_hint = 0; + pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL, get_order(pcxl_res_size)); - memset(pcxl_res_map, 0, pcxl_res_size); - proc_gsc_root = proc_mkdir("gsc", 0); - create_proc_info_entry("dino", 0, proc_gsc_root, pcxl_proc_info); - return 0; + memset(pcxl_res_map, 0, pcxl_res_size); + proc_gsc_root = proc_mkdir("gsc", 0); + if (!proc_gsc_root) + printk(KERN_WARNING + "pcxl_dma_init: Unable to create gsc /proc dir entry\n"); + else { + struct proc_dir_entry* ent; + ent = create_proc_info_entry("dino", 0, + proc_gsc_root, pcxl_proc_info); + if (!ent) + printk(KERN_WARNING + "pci-dma.c: Unable to create dino /proc entry.\n"); + } + return 0; } __initcall(pcxl_dma_init);