This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 61655bea3a6 drivers/rpmsg/rpmsg_virtio: destroy the services before
unregistering
61655bea3a6 is described below
commit 61655bea3a6c98eb39c53c56ddcdbf1c41a28d45
Author: zhangyuan29 <[email protected]>
AuthorDate: Mon Nov 2 18:06:12 2026 +0800
drivers/rpmsg/rpmsg_virtio: destroy the services before unregistering
rpmsg_virtio_remove() called rpmsg_unregister(), which destroys
rpmsg->lock, before rpmsg_device_destroy(), which still takes that lock
to free the pending bind records. Destroy the rpmsg services first, then
deinit the work queues and unregister the device.
Signed-off-by: zhangyuan29 <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
---
drivers/rpmsg/rpmsg_virtio.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/rpmsg/rpmsg_virtio.c b/drivers/rpmsg/rpmsg_virtio.c
index ff9f21258ac..b4d0d85dca0 100644
--- a/drivers/rpmsg/rpmsg_virtio.c
+++ b/drivers/rpmsg/rpmsg_virtio.c
@@ -1035,22 +1035,22 @@ void rpmsg_virtio_remove(FAR struct virtio_device *vdev)
pm_wakelock_uninit(&priv->wakelock);
#endif
- /* Unregister the rpmsg */
-
- snprintf(name, sizeof(name), "/dev/rpmsg/%s", priv->rpmsg.cpuname);
- rpmsg_unregister(name, &priv->rpmsg);
-
/* Disable tx buffer return callback */
virtqueue_disable_cb(priv->rvdev.svq);
+ /* Destroy all the rpmsg services */
+
+ rpmsg_device_destroy(&priv->rpmsg);
+
/* Deinit the rpmsg wqueues */
rpmsg_deinit_wqueues(&priv->rpmsg);
- /* Destroy all the rpmsg services */
+ /* Unregister the rpmsg */
- rpmsg_device_destroy(&priv->rpmsg);
+ snprintf(name, sizeof(name), "/dev/rpmsg/%s", priv->rpmsg.cpuname);
+ rpmsg_unregister(name, &priv->rpmsg);
/* Reset the rpmsg virtio device for driver */