Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
	inode = file->f_dentry->d_inode;
	fbidx = iminor(inode);
	fbidx = iminor(inode);
	info = registered_fb[fbidx];
	info = registered_fb[fbidx];
	par = info->par;


	if (!info || !info->screen_base)
	if (!info || !info->screen_base)
		return -ENODEV;
		return -ENODEV;


	par = info->par;
	xres = info->var.xres;
	xres = info->var.xres;
	fbmemlength = (xres * info->var.yres)/8;
	fbmemlength = (xres * info->var.yres)/8;