rpmsg: don't return error when no more buffer available but wait

If no buffer is available _rpmsg_virtio_get_buffer_size returns 0.
in this case "size > avail_size" is true so we leave the function
without waiting buffer release. Patch consists in ignoring the
test if avail_size is null.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
This commit is contained in:
Arnaud Pouliquen
2020-02-20 08:45:57 +01:00
parent 007f2fe640
commit 80ad0aa698
+1 -1
View File
@@ -308,7 +308,7 @@ static int rpmsg_virtio_send_offchannel_raw(struct rpmsg_device *rdev,
/* Lock the device to enable exclusive access to virtqueues */
metal_mutex_acquire(&rdev->lock);
avail_size = _rpmsg_virtio_get_buffer_size(rvdev);
if (size > avail_size) {
if (avail_size && size > avail_size) {
metal_mutex_release(&rdev->lock);
return RPMSG_ERR_BUFF_SIZE;
}