rptun: fix use after free caused by API wrong order
remove list delete from rptun_dev_stop Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
2fae0af914
commit
83a3b969a3
@ -765,7 +765,6 @@ static int rptun_dev_stop(FAR struct remoteproc *rproc)
|
||||
/* Remove priv from list */
|
||||
|
||||
nxrmutex_lock(&g_rptun_lockcb);
|
||||
metal_list_del(&priv->node);
|
||||
|
||||
/* Broadcast device_destroy to all registers */
|
||||
|
||||
@ -786,8 +785,8 @@ static int rptun_dev_stop(FAR struct remoteproc *rproc)
|
||||
|
||||
/* Remote proc remove */
|
||||
|
||||
remoteproc_remove_virtio(rproc, priv->rvdev.vdev);
|
||||
rpmsg_deinit_vdev(&priv->rvdev);
|
||||
remoteproc_remove_virtio(rproc, priv->rvdev.vdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user