vhost: fix to check the return value of copy_to/from_user() correctly
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Thu, 27 May 2010 09:58:03 +0000 (18:58 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 27 May 2010 10:54:59 +0000 (13:54 +0300)
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 <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

No differences found