Commit 8aacba7b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] fix warning in fbmem.c

Fix a const/non-const warning.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent cb1f4009
......@@ -920,26 +920,30 @@ fb_cursor(struct fb_info *info, struct fb_cursor *sprite)
if (cursor.set & FB_CUR_SETSHAPE) {
int size = ((cursor.image.width + 7) >> 3) * cursor.image.height;
char *data, *mask;
if ((cursor.image.height != info->cursor.image.height) ||
(cursor.image.width != info->cursor.image.width))
cursor.set |= FB_CUR_SETSIZE;
cursor.image.data = kmalloc(size, GFP_KERNEL);
if (!cursor.image.data)
data = kmalloc(size, GFP_KERNEL);
if (!data)
return -ENOMEM;
cursor.mask = kmalloc(size, GFP_KERNEL);
if (!cursor.mask) {
kfree(cursor.image.data);
mask = kmalloc(size, GFP_KERNEL);
if (!mask) {
kfree(data);
return -ENOMEM;
}
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);
if (copy_from_user(data, sprite->image.data, size) ||
copy_from_user(mask, sprite->mask, size)) {
kfree(data);
kfree(mask);
return -EFAULT;
}
cursor.image.data = data;
cursor.mask = mask;
}
info->cursor.set = cursor.set;
info->cursor.rop = cursor.rop;
......
......@@ -376,7 +376,7 @@ struct fb_cursor {
__u16 set; /* what to set */
__u16 enable; /* cursor on/off */
__u16 rop; /* bitop operation */
char *mask; /* cursor mask bits */
const char *mask; /* cursor mask bits */
struct fbcurpos hot; /* cursor hot spot */
struct fb_image image; /* Cursor image */
};
......
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