Re: [PATCH] serial167.c: bugfixes and cleanups

From: Arnaldo Carvalho de Melo (acme@conectiva.com.br)
Date: Fri Aug 25 2000 - 14:12:52 EST


Em Fri, Aug 25, 2000 at 11:04:05PM +0100, Tigran Aivazian escreveu:
> Hi Arnaldo,
>
> On Fri, 25 Aug 2000, Arnaldo Carvalho de Melo wrote:
> > - copy_to_user(retinfo,&tmp,sizeof(*retinfo));
> > + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
> > + return -EFAULT;
> > return 0;
>
> I think Linus already suggested that you do this:
>
> return copy_to_user(...) ? -EFAULT : 0;
>
> it is compact and intuitive.

ok, ok, I got rid of the copy_to_user_ret and forgot about these,
anyway, there were two more bugs in this driver and I was about to
send a new patch, updating...

- 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/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:17 EST