aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorOlaf Hering <olh@suse.de>2006-08-05 15:13:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-08-06 11:57:46 -0400
commitc3760ae1f914cf4479301a92c58ae65824ac5894 (patch)
treeda42f8816a171f8a67583c55d1551518e2c3e001 /drivers/video
parent06fa45d3a19c6fbfccbf295e9f08087492338631 (diff)
[PATCH] crash in aty128_set_lcd_enable() on PowerBook
Current Linus tree crashes in aty128_set_lcd_enable() because par->pdev is NULL. This happens since at least a week. Call trace is: aty128_set_lcd_enable aty128fb_set_par fbcon_init visual_init take_over_console fbcon_takeover notifier_call_chain blocking_notifier_call_chain register_framebuffer aty128fb_probe pci_device_probe bus_for_each_dev driver_attach bus_add_driver driver_register __pci_register_driver aty128fb_init init kernel_thread - info->fix was assigned twice. - par->vram_size is assigned in aty128_probe(), no need to redo it again in aty128_init() - register_framebuffer() uses uninitialized struct members, move it past par->pdev assignment and past aty128_bl_init(). Signed-off-by: Olaf Hering <olh@suse.de> Acked-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/aty/aty128fb.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 8b08121b390b..3e827e04a2aa 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1913,9 +1913,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
1913 u8 chip_rev; 1913 u8 chip_rev;
1914 u32 dac; 1914 u32 dac;
1915 1915
1916 if (!par->vram_size) /* may have already been probed */
1917 par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
1918
1919 /* Get the chip revision */ 1916 /* Get the chip revision */
1920 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F; 1917 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
1921 1918
@@ -2028,9 +2025,6 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2028 2025
2029 aty128_init_engine(par); 2026 aty128_init_engine(par);
2030 2027
2031 if (register_framebuffer(info) < 0)
2032 return 0;
2033
2034 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM); 2028 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);
2035 par->pdev = pdev; 2029 par->pdev = pdev;
2036 par->asleep = 0; 2030 par->asleep = 0;
@@ -2040,6 +2034,9 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
2040 aty128_bl_init(par); 2034 aty128_bl_init(par);
2041#endif 2035#endif
2042 2036
2037 if (register_framebuffer(info) < 0)
2038 return 0;
2039
2043 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", 2040 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",
2044 info->node, info->fix.id, video_card); 2041 info->node, info->fix.id, video_card);
2045 2042
@@ -2089,7 +2086,6 @@ static int __devinit aty128_probe(struct pci_dev *pdev, const struct pci_device_
2089 par = info->par; 2086 par = info->par;
2090 2087
2091 info->pseudo_palette = par->pseudo_palette; 2088 info->pseudo_palette = par->pseudo_palette;
2092 info->fix = aty128fb_fix;
2093 2089
2094 /* Virtualize mmio region */ 2090 /* Virtualize mmio region */
2095 info->fix.mmio_start = reg_addr; 2091 info->fix.mmio_start = reg_addr;