Messages in this thread |  | | Subject | Re: [PATCH] serial167.c: bugfixes and cleanups | From | Jes Sorensen <> | Date | 26 Aug 2000 16:21:17 +0200 |
| |
>>>>> "Tigran" == Tigran Aivazian <tigran@veritas.com> writes:
Tigran> Hi Arnaldo, On Fri, 25 Aug 2000, Arnaldo Carvalho de Melo Tigran> wrote: >> - copy_to_user(retinfo,&tmp,sizeof(*retinfo)); + if >> (copy_to_user(retinfo,&tmp,sizeof(*retinfo))) + return -EFAULT; >> return 0;
Tigran> I think Linus already suggested that you do this:
Tigran> return copy_to_user(...) ? -EFAULT : 0;
Tigran> it is compact and intuitive.
Why? the other one will, do exactly the same and is just as readable. It's the copy_from_user_ret() that is the real problem.
Jes - 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/
|  |