diff options
| author | Adrian Bunk <bunk@stusta.de> | 2007-03-22 04:11:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-22 22:39:05 -0400 |
| commit | 47ebea8351061f763089f6c3e2d2403715b510e1 (patch) | |
| tree | c35bf89557e51b6577bc151bd8205ffe0137d690 | |
| parent | fffda91e2e7ffcc4f60b8666a59f64f28081ce63 (diff) | |
[PATCH] drivers/video/s3fb.c: fix a use-before-check
NULL checks should be before the first dereference.
Spotted by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Ondrej Zajicek <santiago@crfreenet.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | drivers/video/s3fb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 98919a6975f0..3091b20124b4 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
| @@ -1000,11 +1000,12 @@ err_enable_device: | |||
| 1000 | static void __devexit s3_pci_remove(struct pci_dev *dev) | 1000 | static void __devexit s3_pci_remove(struct pci_dev *dev) |
| 1001 | { | 1001 | { |
| 1002 | struct fb_info *info = pci_get_drvdata(dev); | 1002 | struct fb_info *info = pci_get_drvdata(dev); |
| 1003 | struct s3fb_info *par = info->par; | ||
| 1004 | 1003 | ||
| 1005 | if (info) { | 1004 | if (info) { |
| 1006 | 1005 | ||
| 1007 | #ifdef CONFIG_MTRR | 1006 | #ifdef CONFIG_MTRR |
| 1007 | struct s3fb_info *par = info->par; | ||
| 1008 | |||
| 1008 | if (par->mtrr_reg >= 0) { | 1009 | if (par->mtrr_reg >= 0) { |
| 1009 | mtrr_del(par->mtrr_reg, 0, 0); | 1010 | mtrr_del(par->mtrr_reg, 0, 0); |
| 1010 | par->mtrr_reg = -1; | 1011 | par->mtrr_reg = -1; |
