mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
bluetooth: replace leave_critical_section with spin_unlock_irqrestore
since the resouce in bt_buf is protected by spin_lock_irqresave Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Alin Jerpelea
parent
3dfb897ed1
commit
5c0d430b99
@@ -290,7 +290,7 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type,
|
|||||||
buf = g_buf_free;
|
buf = g_buf_free;
|
||||||
g_buf_free = buf->flink;
|
g_buf_free = buf->flink;
|
||||||
|
|
||||||
leave_critical_section(flags);
|
spin_unlock_irqrestore(flags);
|
||||||
pool = POOL_BUFFER_GENERAL;
|
pool = POOL_BUFFER_GENERAL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -300,7 +300,7 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type,
|
|||||||
* will have to allocate one from the kernel memory pool.
|
* will have to allocate one from the kernel memory pool.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
leave_critical_section(flags);
|
spin_unlock_irqrestore(flags);
|
||||||
buf = (FAR struct bt_buf_s *)
|
buf = (FAR struct bt_buf_s *)
|
||||||
kmm_malloc((sizeof (struct bt_buf_s)));
|
kmm_malloc((sizeof (struct bt_buf_s)));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user