]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pvcalls-front: don't return error when the ring is full
authorStefano Stabellini <sstabellini@kernel.org>
Fri, 21 Dec 2018 23:06:32 +0000 (15:06 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:35:32 +0000 (20:35 +0100)
[ 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>
drivers/xen/pvcalls-front.c

index 3a144eecb6a728f639cbb82728d87b4fb993ac70..d7438fdc57061ef9b1479e4e39fc88540e1f5cd3 100644 (file)
@@ -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;