@@ -92,7 +92,7 @@ enum acm_addr_preload {
};
/*
- * Nested locking order: dest -> ep, dest -> port
+ * Nested locking order: dest -> ep, dest -> port, port -> ep
*/
struct acm_dest {
uint8_t address[ACM_MAX_ADDRESS]; /* keep first */
@@ -1830,8 +1830,12 @@ acm_get_port_ep(struct acm_port *port, struct acm_ep_addr_data *data)
(!data->info.path.pkey || (ntohs(data->info.path.pkey) == ep->pkey)))
return ep;
- if (acm_addr_index(ep, data->info.addr, (uint8_t) data->type) >= 0)
+ lock_acquire(&ep->lock);
+ if (acm_addr_index(ep, data->info.addr, (uint8_t) data->type) >= 0) {
+ lock_release(&ep->lock);
return ep;
+ }
+ lock_release(&ep->lock);
}
return NULL;