diff options
author | Stefano Stabellini <sstabellini@kernel.org> | 2018-12-21 15:06:32 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-17 20:35:32 +0100 |
commit | 36a2e9bf242b49ac6be1e8d57d6da2099d93e405 (patch) | |
tree | da80d1be1439e33908659cfa7fbeac91683a59b3 | |
parent | 1fb59428912ed7cf21a4946be5406ccc2fdee50b (diff) | |
download | linux-rt-36a2e9bf242b49ac6be1e8d57d6da2099d93e405.tar.gz |
pvcalls-front: don't return error when the ring is full
[ Upstream commit d90a1ca60a1eccb4383fe203c76223ab4c0799ed ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/xen/pvcalls-front.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index 3a144eecb6a7..d7438fdc5706 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -504,8 +504,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; |