diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-09-11 21:13:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-11 23:43:47 -0400 |
commit | 883f64510718e7df9abbfeec4748d92745d8cc3e (patch) | |
tree | 49cba3bb78cbf5329029948593eee9610794f669 /drivers/video | |
parent | 81d4903d2d17a9f33ece2666185a8b51e6935ae0 (diff) |
[PATCH] i810fb: Fix oops if CONFIG_FB_I810_I2C is set to no
Reported by: Manuel Lauss <mano@roarinelk.homelinux.net>
compiled with CONFIG_FB_I810_I2C = n and CONFIG_FB_I810 = y
it oopses at boot in file drivers/video/i810/i810_main.c:1884
...
Unable to handle kernel NULL pointer dereference at virtual address 00000054
printing eip:
c02543c0
*pde = 00000000
Oops: 0000 [#1]
last sysfs file:
Modules linked in:
CPU: 0
EIP: 0060:[<c02543c0>] Not tainted VLI
EFLAGS: 00010286 (2.6.13-mm2)
EIP is at i810fb_find_init_mode+0x53/0x93
eax: c113ddd4 ebx: c1194000 ecx: c04be2dd edx: c1194000
esi: c1194008 edi: c113ddd4 ebp: c1194240 esp: c113ddcc
ds: 007b es: 007b ss: 0068
struct fb_monspecs *specs is initialized to NULL causing the oops.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/i810/i810_main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 7018ffffcbc4..6f11989f54e3 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -950,7 +950,7 @@ static int i810_check_params(struct fb_var_screeninfo *var, | |||
950 | struct fb_info *info) | 950 | struct fb_info *info) |
951 | { | 951 | { |
952 | struct i810fb_par *par = (struct i810fb_par *) info->par; | 952 | struct i810fb_par *par = (struct i810fb_par *) info->par; |
953 | int line_length, vidmem, mode_valid = 0; | 953 | int line_length, vidmem, mode_valid = 0, retval = 0; |
954 | u32 vyres = var->yres_virtual, vxres = var->xres_virtual; | 954 | u32 vyres = var->yres_virtual, vxres = var->xres_virtual; |
955 | /* | 955 | /* |
956 | * Memory limit | 956 | * Memory limit |
@@ -1026,10 +1026,11 @@ static int i810_check_params(struct fb_var_screeninfo *var, | |||
1026 | printk("i810fb: invalid video mode%s\n", | 1026 | printk("i810fb: invalid video mode%s\n", |
1027 | default_sync ? "" : ". Specifying " | 1027 | default_sync ? "" : ". Specifying " |
1028 | "vsyncN/hsyncN parameters may help"); | 1028 | "vsyncN/hsyncN parameters may help"); |
1029 | retval = -EINVAL; | ||
1029 | } | 1030 | } |
1030 | } | 1031 | } |
1031 | 1032 | ||
1032 | return 0; | 1033 | return retval; |
1033 | } | 1034 | } |
1034 | 1035 | ||
1035 | /** | 1036 | /** |
@@ -1830,7 +1831,7 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info) | |||
1830 | { | 1831 | { |
1831 | struct fb_videomode mode; | 1832 | struct fb_videomode mode; |
1832 | struct fb_var_screeninfo var; | 1833 | struct fb_var_screeninfo var; |
1833 | struct fb_monspecs *specs = NULL; | 1834 | struct fb_monspecs *specs = &info->monspecs; |
1834 | int found = 0; | 1835 | int found = 0; |
1835 | #ifdef CONFIG_FB_I810_I2C | 1836 | #ifdef CONFIG_FB_I810_I2C |
1836 | int i; | 1837 | int i; |
@@ -1853,12 +1854,11 @@ static void __devinit i810fb_find_init_mode(struct fb_info *info) | |||
1853 | if (!err) | 1854 | if (!err) |
1854 | printk("i810fb_init_pci: DDC probe successful\n"); | 1855 | printk("i810fb_init_pci: DDC probe successful\n"); |
1855 | 1856 | ||
1856 | fb_edid_to_monspecs(par->edid, &info->monspecs); | 1857 | fb_edid_to_monspecs(par->edid, specs); |
1857 | 1858 | ||
1858 | if (info->monspecs.modedb == NULL) | 1859 | if (specs->modedb == NULL) |
1859 | printk("i810fb_init_pci: Unable to get Mode Database\n"); | 1860 | printk("i810fb_init_pci: Unable to get Mode Database\n"); |
1860 | 1861 | ||
1861 | specs = &info->monspecs; | ||
1862 | fb_videomode_to_modelist(specs->modedb, specs->modedb_len, | 1862 | fb_videomode_to_modelist(specs->modedb, specs->modedb_len, |
1863 | &info->modelist); | 1863 | &info->modelist); |
1864 | if (specs->modedb != NULL) { | 1864 | if (specs->modedb != NULL) { |