On Thu, Nov 07, 2002 at 11:05:28AM +0800, Antonino Daplas wrote: > On Thu, 2002-11-07 at 06:56, Ville Syrj�l� wrote: > > The matroxfb patch that is included in DirectFB is broken. Here's a new > > patch. get_user() usage was apparently wrong. So I threw it out and things > > work a lot better. > > > > Is there anything wrong with the following? > > int c > > if (get_user(c, (u32 *) arg) > return -EFAULT;
That's exactly what the patch had. But it needs a pointer as argument which means an additional variable for simply passing a single number. The DirectFB code simply calls ioctl(fd, FBIO_WAITFORVSYNC, 1) and since the ioctl handler doesn't dereference the argument things shouldn't explode right? If no argument is passed it will simply be some random number which can of course lead to waiting for the wrong interrupt but still things should not oops. I've tried to look at some other drivers for guidance but it seems that some use get_user() and some don't. Also ioctl_list(2) list many ioctls using using just (int) and others using (int *). If anyone knows which is the right way I'd like to know. -- Ville Syrj�l� [EMAIL PROTECTED] http://www.sci.fi/~syrjala/ -- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.
