From: Antonino A. Daplas Date: Sat, 11 Mar 2006 11:27:23 +0000 (-0800) Subject: [PATCH] arcfb: Fix dereference before NULL check X-Git-Tag: v2.6.16-rc6~14 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=939205b27312b7d7c4c55624ba785e554b39ecbb;p=linux-2.6 [PATCH] arcfb: Fix dereference before NULL check info->par is dereferenced before info is checked for NULL. Fix. Coverity Bug 833 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index 0cf26da75b..466042808d 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c @@ -459,11 +459,11 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou inode = file->f_dentry->d_inode; fbidx = iminor(inode); info = registered_fb[fbidx]; - par = info->par; if (!info || !info->screen_base) return -ENODEV; + par = info->par; xres = info->var.xres; fbmemlength = (xres * info->var.yres)/8;