Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36a2e9bf authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Greg Kroah-Hartman
Browse files

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: default avatarStefano Stabellini <stefanos@xilinx.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1fb59428
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;