Changeset 26a6ed4 in mainline for kernel/generic/src/ipc/ipcrsc.c
- Timestamp:
- 2018-03-11T07:35:05Z (7 years ago)
- Children:
- bbf38ad
- Parents:
- 813fc8c
- git-author:
- Jakub Jermar <jakub@…> (2018-03-10 18:18:12)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-11 07:35:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipcrsc.c
r813fc8c r26a6ed4 150 150 /** Allocate new phone in the specified task. 151 151 * 152 * @param task Task for which to allocate a new phone. 153 * 154 * @param[out] out_handle New phone capability handle. 152 * @param[in] task Task for which to allocate a new phone. 153 * @param[in] publish If true, the new capability will be published. 154 * @param[out] phandle New phone capability handle. 155 * @param[out] kobject New phone kobject. 155 156 * 156 157 * @return An error code if a new capability cannot be allocated. 157 158 */ 158 errno_t phone_alloc(task_t *task, cap_handle_t *out_handle) 159 errno_t phone_alloc(task_t *task, bool publish, cap_handle_t *phandle, 160 kobject_t **kobject) 159 161 { 160 162 cap_handle_t handle; … … 166 168 return ENOMEM; 167 169 } 168 kobject_t *kobj ect= malloc(sizeof(kobject_t), FRAME_ATOMIC);169 if (!kobj ect) {170 kobject_t *kobj = malloc(sizeof(kobject_t), FRAME_ATOMIC); 171 if (!kobj) { 170 172 cap_free(TASK, handle); 171 173 slab_free(phone_cache, phone); … … 176 178 phone->state = IPC_PHONE_CONNECTING; 177 179 178 kobject_initialize(kobj ect, KOBJECT_TYPE_PHONE, phone,180 kobject_initialize(kobj, KOBJECT_TYPE_PHONE, phone, 179 181 &phone_kobject_ops); 180 phone->kobject = kobject; 181 182 cap_publish(task, handle, kobject); 183 184 *out_handle = handle; 182 phone->kobject = kobj; 183 184 if (publish) 185 cap_publish(task, handle, kobj); 186 187 *phandle = handle; 188 if (kobject) 189 *kobject = kobj; 185 190 } 186 191 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.