提交 d90a1ca6 编写于 作者: S Stefano Stabellini 提交者: Boris Ostrovsky

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: NStefano Stabellini <stefanos@xilinx.com>
Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
上级 beee1fbe
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册