xen-gntdev: return -EFAULT on copy_to_user failure
authorDan Carpenter <error27@gmail.com>
Sat, 19 Mar 2011 05:44:34 +0000 (08:44 +0300)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 24 Mar 2011 14:32:44 +0000 (10:32 -0400)
commit12f0258d5b44b3b5a9442ec461bbac1f7edab8c6
tree9dbaf66cde561ec613e5bd838a7a52642c3b1ae4
parent804f18536984939622ddca60ab6b25743e0ec68d
xen-gntdev: return -EFAULT on copy_to_user failure

copy_to_user() returns the amount of data remaining to be copied.  We
want to return a negative error code here.  The upper layers just
call WARN_ON() if we return non-zero so this doesn't change the
behavior.  But returning -EFAULT is still cleaner.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/gntdev.c