diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2009-09-22 19:47:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:51 -0400 |
commit | bc6932bb4a25ced97c4f201874573e6097237b78 (patch) | |
tree | f7bc89b68a935d1951c086aa692fd62319b420b8 /drivers/video/via | |
parent | 09cf11806e4b4be92af76253ff9834c48b416129 (diff) |
viafb: fix ioremap_nocache error handling
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: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/via')
-rw-r--r-- | drivers/video/via/viafbdev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 743eed48a5f7..72759b620e7f 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -2134,12 +2134,16 @@ static int __devinit via_pci_probe(void) | |||
2134 | 2134 | ||
2135 | if (!viaparinfo->fbmem_virt) { | 2135 | if (!viaparinfo->fbmem_virt) { |
2136 | printk(KERN_INFO "ioremap failed\n"); | 2136 | printk(KERN_INFO "ioremap failed\n"); |
2137 | return -1; | 2137 | return -ENOMEM; |
2138 | } | 2138 | } |
2139 | 2139 | ||
2140 | viafb_get_mmio_info(&viaparinfo->mmio_base, &viaparinfo->mmio_len); | 2140 | viafb_get_mmio_info(&viaparinfo->mmio_base, &viaparinfo->mmio_len); |
2141 | viaparinfo->io_virt = ioremap_nocache(viaparinfo->mmio_base, | 2141 | viaparinfo->io_virt = ioremap_nocache(viaparinfo->mmio_base, |
2142 | viaparinfo->mmio_len); | 2142 | viaparinfo->mmio_len); |
2143 | if (!viaparinfo->io_virt) { | ||
2144 | printk(KERN_WARNING "ioremap failed: hardware acceleration disabled\n"); | ||
2145 | viafb_accel = 0; | ||
2146 | } | ||
2143 | 2147 | ||
2144 | viafbinfo->node = 0; | 2148 | viafbinfo->node = 0; |
2145 | viafbinfo->fbops = &viafb_ops; | 2149 | viafbinfo->fbops = &viafb_ops; |