mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-09-25 19:14:02 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user