sensors/sensor_rpmsg.c: fix list_delete node is NULL
if remote not set CONFIG_SENSOR_RPMSG, local can't receive NS_ACK so sensor_rpmsg_device_ns_bound won't be called, not add sre->node when local stop remote, rpmsg_deinit_vdev will call sensor_rpmsg_ns_unbind_cb if (ept && ept->ns_unbind_cb) ept->ns_unbind_cb(ept); list_delete node is NULL at sensor_rpmsg_ns_unbind_cb Signed-off-by: yintao <yintao@xiaomi.com>
This commit is contained in:
parent
d72d9049e9
commit
ef9a02f51c
|
@ -1303,7 +1303,11 @@ static void sensor_rpmsg_ns_unbind_cb(FAR struct rpmsg_endpoint *ept)
|
|||
nxrmutex_unlock(&g_dev_lock);
|
||||
|
||||
nxrmutex_lock(&g_ept_lock);
|
||||
list_delete(&sre->node);
|
||||
if (list_in_list(&sre->node))
|
||||
{
|
||||
list_delete(&sre->node);
|
||||
}
|
||||
|
||||
nxrmutex_unlock(&g_ept_lock);
|
||||
|
||||
nxrmutex_destroy(&sre->lock);
|
||||
|
|
Loading…
Reference in New Issue