mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* updated-fbmem-patch.patch
@ 2004-04-21  2:10 Andrea Arcangeli
  2004-04-21 22:41 ` updated-fbmem-patch.patch Chris Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Andrea Arcangeli @ 2004-04-21  2:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: arjanv, linux-kernel

http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.5/2.6.5-mm4/broken-out/updated-fbmem-patch.patch

this uses get_user for the set_cmap operation too.

--- 2.6.5-aa3/drivers/video/fbmem.c.~1~	2004-04-04 08:09:23.000000000 +0200
+++ 2.6.5-aa3/drivers/video/fbmem.c	2004-04-21 03:11:05.878951424 +0200
@@ -1034,11 +1034,11 @@ fb_ioctl(struct inode *inode, struct fil
 	case FBIOPUTCMAP:
 		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
 			return -EFAULT;
-		return (fb_set_cmap(&cmap, 0, info));
+		return (fb_set_cmap(&cmap, 1, info));
 	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;

this is the port to 2.4:

--- 2.4.23aa2/drivers/video/fbmem.c.~1~	2003-08-26 00:13:02.000000000 +0200
+++ 2.4.23aa2/drivers/video/fbmem.c	2004-04-21 03:13:34.545350696 +0200
@@ -511,11 +511,11 @@ fb_ioctl(struct inode *inode, struct fil
 	case FBIOPUTCMAP:
 		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
 			return -EFAULT;
-		return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(info), info));
+		return (fb->fb_set_cmap(&cmap, 1, PROC_CONSOLE(info), info));
 	case FBIOGETCMAP:
 		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
 			return -EFAULT;
-		return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(info), info));
+		return (fb->fb_get_cmap(&cmap, 1, PROC_CONSOLE(info), info));
 	case FBIOPAN_DISPLAY:
 		if (copy_from_user(&var, (void *) arg, sizeof(var)))
 			return -EFAULT;


(1 not a typo)

Let me know if you see something wrong, it's untested.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-21 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-21  2:10 updated-fbmem-patch.patch Andrea Arcangeli
2004-04-21 22:41 ` updated-fbmem-patch.patch Chris Wright
2004-04-21 22:57   ` updated-fbmem-patch.patch Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®