提交 47ebea83 编写于 作者: A Adrian Bunk 提交者: Linus Torvalds

[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: NAdrian Bunk <bunk@stusta.de>
Acked-by: NOndrej Zajicek <santiago@crfreenet.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 fffda91e
......@@ -1000,11 +1000,12 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册