Commit 939205b2 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[PATCH] arcfb: Fix dereference before NULL check

info->par is dereferenced before info is checked for NULL. Fix.

Coverity Bug 833
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 16afe814
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment