mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
drivers/rpmsgrtc: fix crash because list_node is not in server list
Fix potential crash when removing client from server list. Add proper list initialization check before deletion operation. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -716,7 +716,11 @@ static void rpmsg_rtc_server_ept_release(FAR struct rpmsg_endpoint *ept)
|
|||||||
FAR struct rpmsg_rtc_server_s *server = ept->priv;
|
FAR struct rpmsg_rtc_server_s *server = ept->priv;
|
||||||
|
|
||||||
nxmutex_lock(&server->lock);
|
nxmutex_lock(&server->lock);
|
||||||
list_delete(&client->node);
|
if (list_in_list(&client->node))
|
||||||
|
{
|
||||||
|
list_delete(&client->node);
|
||||||
|
}
|
||||||
|
|
||||||
nxmutex_unlock(&server->lock);
|
nxmutex_unlock(&server->lock);
|
||||||
kmm_free(client);
|
kmm_free(client);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user