Changeset 6a32cc5f in mainline


Ignore:
Timestamp:
2017-12-18T17:09:18Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
09d01f2
Parents:
90f20cf
Message:

Handle allocation failure in task_create().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/task.c

    r90f20cf r6a32cc5f  
    207207{
    208208        task_t *task = (task_t *) slab_alloc(task_cache, 0);
     209        if (task == NULL) {
     210                return NULL;
     211        }
     212       
    209213        task_create_arch(task);
    210214       
     
    242246            (container_check(ipc_phone_0->task->container, task->container))) {
    243247                cap_handle_t phone_handle = phone_alloc(task);
     248                if (phone_handle < 0) {
     249                        task->as = NULL;
     250                        task_destroy_arch(task);
     251                        slab_free(task_cache, task);
     252                        return NULL;
     253                }
     254               
    244255                kobject_t *phone_obj = kobject_get(task, phone_handle,
    245256                    KOBJECT_TYPE_PHONE);
Note: See TracChangeset for help on using the changeset viewer.