]> git.baikalelectronics.ru Git - kernel.git/commit
vhost_vdpa: return -EFAULT if copy_to_user() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 2 Dec 2020 06:44:43 +0000 (09:44 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 2 Dec 2020 09:36:40 +0000 (04:36 -0500)
commitd960cd9a147afb2642b3cf1e29fdff823576d26b
treee2fecdf55e0f458b58b665593b43644cb7d30bac
parent6d9b442289777dcdcaf8439ff7a8c8a7b764f5ed
vhost_vdpa: return -EFAULT if copy_to_user() fails

The copy_to_user() function returns the number of bytes remaining to be
copied but this should return -EFAULT to the user.

Fixes: fda1f1fe2687 ("vhost: vdpa: report iova range")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/X8c32z5EtDsMyyIL@mwanda
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
drivers/vhost/vdpa.c