lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cleanup on selection.c
Em Fri, Aug 25, 2000 at 11:43:40AM -0400, Matthew Wilcox escreveu:
> On Fri, Aug 25, 2000 at 10:05:19AM -0300, Arnaldo Carvalho de Melo wrote:
> > --- linux-2.4.0-test7/drivers/char/selection.c Tue Aug 31 15:30:48 1999
> > +++ linux-2.4.0-test7.acme/drivers/char/selection.c Fri Aug 25 09:40:50 2000
> > @@ -96,11 +96,8 @@
> > /* set inwordLut contents. Invoked by ioctl(). */
> > int sel_loadlut(const unsigned long arg)
> > {
> > - int err = -EFAULT;
> > -
> > - if (!copy_from_user(inwordLut, (u32 *)(arg+4), 32))
> > - err = 0;
> > - return err;
> > + copy_from_user_ret(inwordLut, (u32 *)(arg+4), 32, -EFAULT);
> > + return 0;
> > }
> >
> > /* does screen address p correspond to character at LH/RH edge of screen? */
>
> this is wrong.
>
> return copy_from_user_ret(inwordLut, (u32 *)(arg+4), 32, -EFAULT);
>
> is what you mean.

nope, look at copy_from_user_ret in include/asm/uaccess.h

#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.130 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site