diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2008-08-05 16:01:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-05 17:33:46 -0400 |
commit | 594a8819774b09ee5bf72d23300489459ff1f882 (patch) | |
tree | 1aa95c45e992c41017cf8be52626af72c17679f8 /drivers/video/s3fb.c | |
parent | c6e2bee26eee190b20cd87e71b288bca6a5357a4 (diff) |
vt8623fb: fix kernel oops
commit 20e061fb750d36ec0ffcb2e44ed7dafa9018223b
Author: Ondrej Zajicek <santiago@crfreenet.org>
Date: Mon Apr 28 02:15:18 2008 -0700
fbdev: framebuffer_alloc() fixes
Correct the dev arg of framebuffer_alloc() in arkfb, s3fb and vt8623fb.
causes a null-pointer deref because "info->dev is NULL, info was just
kzallocated".
Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org>
Reported-by: "MadLoisae@gmx.net" <MadLoisae@gmx.net>
Tested-by: "MadLoisae@gmx.net" <MadLoisae@gmx.net>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: <stable@kernel.org> [2.6.26.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/s3fb.c')
-rw-r--r-- | drivers/video/s3fb.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 2972f112dbed..8361bd0e3df1 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
@@ -903,13 +903,13 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
903 | /* Prepare PCI device */ | 903 | /* Prepare PCI device */ |
904 | rc = pci_enable_device(dev); | 904 | rc = pci_enable_device(dev); |
905 | if (rc < 0) { | 905 | if (rc < 0) { |
906 | dev_err(info->dev, "cannot enable PCI device\n"); | 906 | dev_err(info->device, "cannot enable PCI device\n"); |
907 | goto err_enable_device; | 907 | goto err_enable_device; |
908 | } | 908 | } |
909 | 909 | ||
910 | rc = pci_request_regions(dev, "s3fb"); | 910 | rc = pci_request_regions(dev, "s3fb"); |
911 | if (rc < 0) { | 911 | if (rc < 0) { |
912 | dev_err(info->dev, "cannot reserve framebuffer region\n"); | 912 | dev_err(info->device, "cannot reserve framebuffer region\n"); |
913 | goto err_request_regions; | 913 | goto err_request_regions; |
914 | } | 914 | } |
915 | 915 | ||
@@ -921,7 +921,7 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
921 | info->screen_base = pci_iomap(dev, 0, 0); | 921 | info->screen_base = pci_iomap(dev, 0, 0); |
922 | if (! info->screen_base) { | 922 | if (! info->screen_base) { |
923 | rc = -ENOMEM; | 923 | rc = -ENOMEM; |
924 | dev_err(info->dev, "iomap for framebuffer failed\n"); | 924 | dev_err(info->device, "iomap for framebuffer failed\n"); |
925 | goto err_iomap; | 925 | goto err_iomap; |
926 | } | 926 | } |
927 | 927 | ||
@@ -965,19 +965,19 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
965 | rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); | 965 | rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); |
966 | if (! ((rc == 1) || (rc == 2))) { | 966 | if (! ((rc == 1) || (rc == 2))) { |
967 | rc = -EINVAL; | 967 | rc = -EINVAL; |
968 | dev_err(info->dev, "mode %s not found\n", mode_option); | 968 | dev_err(info->device, "mode %s not found\n", mode_option); |
969 | goto err_find_mode; | 969 | goto err_find_mode; |
970 | } | 970 | } |
971 | 971 | ||
972 | rc = fb_alloc_cmap(&info->cmap, 256, 0); | 972 | rc = fb_alloc_cmap(&info->cmap, 256, 0); |
973 | if (rc < 0) { | 973 | if (rc < 0) { |
974 | dev_err(info->dev, "cannot allocate colormap\n"); | 974 | dev_err(info->device, "cannot allocate colormap\n"); |
975 | goto err_alloc_cmap; | 975 | goto err_alloc_cmap; |
976 | } | 976 | } |
977 | 977 | ||
978 | rc = register_framebuffer(info); | 978 | rc = register_framebuffer(info); |
979 | if (rc < 0) { | 979 | if (rc < 0) { |
980 | dev_err(info->dev, "cannot register framebuffer\n"); | 980 | dev_err(info->device, "cannot register framebuffer\n"); |
981 | goto err_reg_fb; | 981 | goto err_reg_fb; |
982 | } | 982 | } |
983 | 983 | ||
@@ -1053,7 +1053,7 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
1053 | struct fb_info *info = pci_get_drvdata(dev); | 1053 | struct fb_info *info = pci_get_drvdata(dev); |
1054 | struct s3fb_info *par = info->par; | 1054 | struct s3fb_info *par = info->par; |
1055 | 1055 | ||
1056 | dev_info(info->dev, "suspend\n"); | 1056 | dev_info(info->device, "suspend\n"); |
1057 | 1057 | ||
1058 | acquire_console_sem(); | 1058 | acquire_console_sem(); |
1059 | mutex_lock(&(par->open_lock)); | 1059 | mutex_lock(&(par->open_lock)); |
@@ -1085,7 +1085,7 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
1085 | struct s3fb_info *par = info->par; | 1085 | struct s3fb_info *par = info->par; |
1086 | int err; | 1086 | int err; |
1087 | 1087 | ||
1088 | dev_info(info->dev, "resume\n"); | 1088 | dev_info(info->device, "resume\n"); |
1089 | 1089 | ||
1090 | acquire_console_sem(); | 1090 | acquire_console_sem(); |
1091 | mutex_lock(&(par->open_lock)); | 1091 | mutex_lock(&(par->open_lock)); |
@@ -1102,7 +1102,7 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
1102 | if (err) { | 1102 | if (err) { |
1103 | mutex_unlock(&(par->open_lock)); | 1103 | mutex_unlock(&(par->open_lock)); |
1104 | release_console_sem(); | 1104 | release_console_sem(); |
1105 | dev_err(info->dev, "error %d enabling device for resume\n", err); | 1105 | dev_err(info->device, "error %d enabling device for resume\n", err); |
1106 | return err; | 1106 | return err; |
1107 | } | 1107 | } |
1108 | pci_set_master(dev); | 1108 | pci_set_master(dev); |