From: Ondrej Zajicek Date: Fri, 1 Jun 2007 07:46:43 +0000 (-0700) Subject: vt8623fb: arkfb: null pointer dereference fix X-Git-Tag: v2.6.22-rc4~44 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38d473f99575f57f5911c7c94922fcf0b0a58b8d;p=linux-2.6 vt8623fb: arkfb: null pointer dereference fix This patch prevents null pointer dereference in arkfb and vt8623fb. Signed-off-by: Ondrej Zajicek Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index ba6fede5c4..8a1b07c743 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c @@ -1055,9 +1055,10 @@ err_enable_device: static void __devexit ark_pci_remove(struct pci_dev *dev) { struct fb_info *info = pci_get_drvdata(dev); - struct arkfb_info *par = info->par; if (info) { + struct arkfb_info *par = info->par; + #ifdef CONFIG_MTRR if (par->mtrr_reg >= 0) { mtrr_del(par->mtrr_reg, 0, 0); diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index 5e9755e464..30c0b94885 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c @@ -778,9 +778,10 @@ err_enable_device: static void __devexit vt8623_pci_remove(struct pci_dev *dev) { struct fb_info *info = pci_get_drvdata(dev); - struct vt8623fb_info *par = info->par; if (info) { + struct vt8623fb_info *par = info->par; + #ifdef CONFIG_MTRR if (par->mtrr_reg >= 0) { mtrr_del(par->mtrr_reg, 0, 0);