[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070319092552.GP752@stusta.de>
Date: Mon, 19 Mar 2007 10:25:52 +0100
From: Adrian Bunk <bunk@...sta.de>
To: Ondrej Zajicek <santiago@...reenet.org>,
James Simmons <jsimmons@...radead.org>, adaplas@...il.com
Cc: linux-kernel@...r.kernel.org
Subject: [2.6 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@...sta.de>
---
--- linux-2.6.21-rc3-mm2/drivers/video/s3fb.c.old 2007-03-19 09:20:22.000000000 +0100
+++ linux-2.6.21-rc3-mm2/drivers/video/s3fb.c 2007-03-19 09:21:07.000000000 +0100
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists