
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.


---

 25-akpm/drivers/video/fbmem.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/video/fbmem.c~updated-fbmem-patch drivers/video/fbmem.c
--- 25/drivers/video/fbmem.c~updated-fbmem-patch	2004-04-09 21:05:11.700252800 -0700
+++ 25-akpm/drivers/video/fbmem.c	2004-04-09 21:05:11.703252344 -0700
@@ -1038,7 +1038,7 @@ fb_ioctl(struct inode *inode, struct fil
 	case FBIOGETCMAP:
 		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
 			return -EFAULT;
-		return (fb_copy_cmap(&info->cmap, &cmap, 0));
+		return (fb_copy_cmap(&info->cmap, &cmap, 2));
 	case FBIOPAN_DISPLAY:
 		if (copy_from_user(&var, (void *) arg, sizeof(var)))
 			return -EFAULT;

_
