mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Fix a typo that crept into lpc17_allocateheap.c in the recent kernel allocator changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5729 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -189,6 +189,25 @@ int group_allocate(FAR struct task_tcb_s *tcb)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#if CONFIG_NFILE_STREAMS > 0 && defined(CONFIG_NUTTX_KERNEL) && \
|
||||
defined(CONFIG_MM_KERNEL_HEAP)
|
||||
|
||||
/* In a flat, single-heap build. The stream list is allocated with the
|
||||
* group structure. But in a kernel build with a kernel allocator, it
|
||||
* must be separately allocated using a user-space allocator.
|
||||
*/
|
||||
|
||||
group->tg_streamlist = (FAR struct streamlist *)
|
||||
kuzalloc(sizeof(struct streamlist));
|
||||
|
||||
if (!group->tg_streamlist)
|
||||
{
|
||||
kfree(group);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Attach the group to the TCB */
|
||||
|
||||
tcb->cmn.group = group;
|
||||
|
||||
@@ -218,6 +218,17 @@ static inline void group_release(FAR struct task_group_s *group)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_NFILE_STREAMS > 0 && defined(CONFIG_NUTTX_KERNEL) && \
|
||||
defined(CONFIG_MM_KERNEL_HEAP)
|
||||
|
||||
/* In a flat, single-heap build. The stream list is part of the
|
||||
* group structure. But in a kernel build with a kernel allocator, it
|
||||
* must be separately de-allocated user the user-space deallocator.
|
||||
*/
|
||||
|
||||
sched_ufree(group->tg_streamlist);
|
||||
#endif
|
||||
|
||||
/* Release the group container itself */
|
||||
|
||||
sched_kfree(group);
|
||||
|
||||
Reference in New Issue
Block a user