summaryrefslogtreecommitdiffstats
path: root/drivers/video/s3fb.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2007-03-22 09:11:16 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-23 03:39:05 +0100
commit47ebea8351061f763089f6c3e2d2403715b510e1 (patch)
treec35bf89557e51b6577bc151bd8205ffe0137d690 /drivers/video/s3fb.c
parentMerge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 (diff)
downloadlinux-47ebea8351061f763089f6c3e2d2403715b510e1.tar.xz
linux-47ebea8351061f763089f6c3e2d2403715b510e1.zip
[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>
Diffstat (limited to '')
-rw-r--r--drivers/video/s3fb.c3
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:
static void __devexit s3_pci_remove(struct pci_dev *dev)
{
struct fb_info *info = pci_get_drvdata(dev);
- struct s3fb_info *par = info->par;
if (info) {
#ifdef CONFIG_MTRR
+ struct s3fb_info *par = info->par;
+
if (par->mtrr_reg >= 0) {
mtrr_del(par->mtrr_reg, 0, 0);
par->mtrr_reg = -1;