Commit 2b3533c4 authored by Florian Tobias Schandinat's avatar Florian Tobias Schandinat Committed by James Toy

Correct the returned error code for remapping the video framebuffer.

Introduce error handling for remapping MMIO register address space to
avoid a NULL pointer dereference.  Disable hardware acceleration if
remapping MMIO register address space failed as those registers are only
used for hardware acceleration.
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Joseph Chan <JosephChan@via.com.tw>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 98035d5a
......@@ -2134,12 +2134,16 @@ static int __devinit via_pci_probe(void)
if (!viaparinfo->fbmem_virt) {
printk(KERN_INFO "ioremap failed\n");
return -1;
return -ENOMEM;
}
viafb_get_mmio_info(&viaparinfo->mmio_base, &viaparinfo->mmio_len);
viaparinfo->io_virt = ioremap_nocache(viaparinfo->mmio_base,
viaparinfo->mmio_len);
if (!viaparinfo->io_virt) {
printk(KERN_WARNING "ioremap failed: hardware acceleration disabled\n");
viafb_accel = 0;
}
viafbinfo->node = 0;
viafbinfo->fbops = &viafb_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment