]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] framebuffer bugfix
authorAndrew Morton <akpm@osdl.org>
Mon, 12 Apr 2004 08:04:47 +0000 (01:04 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 12 Apr 2004 08:04:47 +0000 (01:04 -0700)
From: Arjan van de Ven <arjanv@redhat.com>

Patch below fixes a thinko in the frame buffer drivers; the code does

cursor.image.data = kmalloc(size, GFP_KERNEL);
....
cursor.mask = kmalloc(size, GFP_KERNEL);
....
                if (copy_from_user(&cursor.image.data, sprite->image.data, size) ||
                    copy_from_user(cursor.mask, sprite->mask, size)) {
....

where it's clear that the & in the first copy_from_user is utterly bogus
since the destination is the content of the newly allocated buffer, and not
the pointer to it as the code does.

drivers/video/fbmem.c

index c1731c7de5b64a59a5ad936a74654f88579bc3ac..0dec2de2303e4878c25f09ee9be414b8570de0ec 100644 (file)
@@ -911,7 +911,7 @@ fb_cursor(struct fb_info *info, struct fb_cursor *sprite)
                        return -ENOMEM;
                }
                
-               if (copy_from_user(&cursor.image.data, sprite->image.data, size) ||
+               if (copy_from_user(cursor.image.data, sprite->image.data, size) ||
                    copy_from_user(cursor.mask, sprite->mask, size)) { 
                        kfree(cursor.image.data);
                        kfree(cursor.mask);