Thread (4 messages) flat view 4 messages, 2 authors, 2003-01-05

Re: fbmem.c : FBIOGETCMAP

From: James Simmons <hidden>
Date: 2003-01-05 20:53:12

It needs a copy_to_user too to work. Probably doesn't
need the copy_from_user.

Is the right fix?

	case FBIOGETCMAP:
		fb_copy_cmap(&info->cmap, &cmap, 0);
		if (copy_to_user((void *) arg, &cmap, sizeof(cmap)))
			return -EFAULT;
		return 0;
Oops. I see the problem. It should be 

  fb_copy_cmap(&info->cmap, &cmap, 2);

This tells it to use copy_to_user. I see a few mistakes here. Fixing...

There are several bugs here. I have to cleanup it up. FOr example in 
fb_copy_cmap there is test for a EFAULT for any copy_* function. This is 
just broken. It has been broken for a long time. Will fix. Will you test 
my patch as soon as it is ready?




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help