Commit 9a6c9ba2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fb_copy_cmap() fix

From: Arjan van de Ven <arjanv@redhat.com>

fb_copy_cmap() takes an argument about wether to do memcpy, copy_from_user or
copy_to_user.  0 is memcpy, 2 is copy_to_user.  In the ioctl you want
copy_to_user for copying the colormap to userspace.
parent e01d652a
...@@ -1038,7 +1038,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -1038,7 +1038,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOGETCMAP: case FBIOGETCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap))) if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT; return -EFAULT;
return (fb_copy_cmap(&info->cmap, &cmap, 0)); return (fb_copy_cmap(&info->cmap, &cmap, 2));
case FBIOPAN_DISPLAY: case FBIOPAN_DISPLAY:
if (copy_from_user(&var, (void *) arg, sizeof(var))) if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT; return -EFAULT;
......
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