PCI hotplug: check ioremap() return value in ibmphp_ebda.c
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 2 Feb 2010 22:45:54 +0000 (14:45 -0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 23 Feb 2010 00:17:19 +0000 (16:17 -0800)
check ioremap() return value.

Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/ibmphp_ebda.c

index 7d3bf31d224d90956f1e3c5d908557585dffc7c9..5becbdee4027019a5c584df5ff5fb3cc99b04cc3 100644 (file)
@@ -261,6 +261,8 @@ int __init ibmphp_access_ebda (void)
        debug ("returned ebda segment: %x\n", ebda_seg);
        
        io_mem = ioremap(ebda_seg<<4, 1);
+       if (!io_mem)
+               return -ENOMEM;
        ebda_sz = readb(io_mem);
        iounmap(io_mem);
        debug("ebda size: %d(KiB)\n", ebda_sz);