summaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorStefano Stabellini <sstabellini@kernel.org>2018-12-22 00:06:32 +0100
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2019-01-02 17:00:31 +0100
commitd90a1ca60a1eccb4383fe203c76223ab4c0799ed (patch)
treea4b61eaf0953ed2005a0ccb3a00d025b2addee56 /drivers/xen
parentpvcalls-front: properly allocate sk (diff)
downloadlinux-d90a1ca60a1eccb4383fe203c76223ab4c0799ed.tar.xz
linux-d90a1ca60a1eccb4383fe203c76223ab4c0799ed.zip
pvcalls-front: don't return error when the ring is full
When the ring is full, size == array_size. It is not an error condition, so simply return 0 instead of an error. Signed-off-by: Stefano Stabellini <stefanos@xilinx.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/pvcalls-front.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 01588582ae66..1a893a164349 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -475,8 +475,10 @@ static int __write_ring(struct pvcalls_data_intf *intf,
virt_mb();
size = pvcalls_queued(prod, cons, array_size);
- if (size >= array_size)
+ if (size > array_size)
return -EINVAL;
+ if (size == array_size)
+ return 0;
if (len > array_size - size)
len = array_size - size;