mirror of
https://github.com/apache/nuttx.git
synced 2026-08-07 05:27:17 +00:00
drivers/serial: check the remote device before get name
| #0 0x2119bf1 in rpmsg_get_cpuname rptun/rptun.c:1157 | #1 0x24f97bd in uart_rpmsg_device_destroy serial/uart_rpmsg.c:342 | #2 0x2117d56 in rptun_dev_stop rptun/rptun.c:883 | #3 0x21181d7 in rptun_do_ioctl rptun/rptun.c:922 | #4 0x2119721 in rptun_ioctl_foreach rptun/rptun.c:1086 Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
93ff6f9703
commit
85a375cd7d
1 changed files with 2 additions and 1 deletions
|
|
@ -339,7 +339,8 @@ static void uart_rpmsg_device_destroy(FAR struct rpmsg_device *rdev,
|
|||
FAR struct uart_dev_s *dev = priv_;
|
||||
FAR struct uart_rpmsg_priv_s *priv = dev->priv;
|
||||
|
||||
if (strcmp(priv->cpuname, rpmsg_get_cpuname(rdev)) == 0)
|
||||
if (priv->ept.priv != NULL &&
|
||||
strcmp(priv->cpuname, rpmsg_get_cpuname(rdev)) == 0)
|
||||
{
|
||||
rpmsg_destroy_ept(&priv->ept);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue