Re: [PATCH 2/3] vhost-net: fix to check the return value of copy_to/from_user() correctly

2010-05-27 Thread Michael S. Tsirkin
On Thu, May 27, 2010 at 07:01:58PM +0900, Takuya Yoshikawa wrote: > copy_to/from_user() returns the number of bytes that could not be copied. > > So we need to check if it is not zero, and in that case, we should return > the error number -EFAULT rather than directly return the return value from >

[PATCH 2/3] vhost-net: fix to check the return value of copy_to/from_user() correctly

2010-05-27 Thread Takuya Yoshikawa
copy_to/from_user() returns the number of bytes that could not be copied. So we need to check if it is not zero, and in that case, we should return the error number -EFAULT rather than directly return the return value from copy_to/from_user(). Signed-off-by: Takuya Yoshikawa --- drivers/vhost/n