diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-11 13:21:33 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-11 13:21:33 +0000 |
commit | c0fe85b4248e9dbd6beb66ef6cd7fb5025c40d1b (patch) | |
tree | 18bc9e860b1c571b02e09105903cf0dec01e36a8 /nuttx/sched | |
parent | dffbc36a6adb56b217a399dd3acfebdd0f1dc5cf (diff) | |
download | px4-nuttx-c0fe85b4248e9dbd6beb66ef6cd7fb5025c40d1b.tar.gz px4-nuttx-c0fe85b4248e9dbd6beb66ef6cd7fb5025c40d1b.tar.bz2 px4-nuttx-c0fe85b4248e9dbd6beb66ef6cd7fb5025c40d1b.zip |
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
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/group_create.c | 19 | ||||
-rw-r--r-- | nuttx/sched/group_leave.c | 11 |
2 files changed, 30 insertions, 0 deletions
diff --git a/nuttx/sched/group_create.c b/nuttx/sched/group_create.c index f2f6ac179..d18fb82f8 100644 --- a/nuttx/sched/group_create.c +++ b/nuttx/sched/group_create.c @@ -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; diff --git a/nuttx/sched/group_leave.c b/nuttx/sched/group_leave.c index 05104b34c..c6a546928 100644 --- a/nuttx/sched/group_leave.c +++ b/nuttx/sched/group_leave.c @@ -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); |