From 2f6eb4f1827b5d1637b1f860eb6e2f3e0e96c47e Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Sat, 19 Oct 2024 01:19:36 +0800 Subject: [PATCH] rpmsg_virtio: fix rpmsg_virtio_get_tx_payload_buffer() error If rpmsg_virtio_notify_wait() returns RPMSG_SUCCESS, we should not directly return NULL instead call rpmsg_virtio_get_tx_buffer to get the tx buffer again. Signed-off-by: Yongrong Wang Signed-off-by: Bowen Wang --- lib/rpmsg/rpmsg_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rpmsg/rpmsg_virtio.c b/lib/rpmsg/rpmsg_virtio.c index eff2438f..00d12464 100644 --- a/lib/rpmsg/rpmsg_virtio.c +++ b/lib/rpmsg/rpmsg_virtio.c @@ -394,7 +394,7 @@ static void *rpmsg_virtio_get_tx_payload_buffer(struct rpmsg_device *rdev, if (status == RPMSG_EOPNOTSUPP) { metal_sleep_usec(RPMSG_TICKS_PER_INTERVAL); tick_count--; - } else if (status == RPMSG_SUCCESS) { + } else if (status != RPMSG_SUCCESS) { break; } }