Changes in kernel/generic/src/ipc/ops/stchngath.c [fafb8e5:455241b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/stchngath.c
rfafb8e5 r455241b 45 45 task_t *other_task_s; 46 46 47 kobject_t *sender_obj =kobject_get(TASK,48 (cap_handle_t) ipc_get_arg5(&call->data), KOBJECT_TYPE_PHONE) ;49 if (!sender_ obj)47 phone_t *sender_phone = phone_from_kobject(kobject_get(TASK, 48 (cap_handle_t) ipc_get_arg5(&call->data), KOBJECT_TYPE_PHONE)); 49 if (!sender_phone) 50 50 return ENOENT; 51 51 52 mutex_lock(&sender_ obj->phone->lock);53 if (sender_ obj->phone->state != IPC_PHONE_CONNECTED) {54 mutex_unlock(&sender_ obj->phone->lock);55 kobject_put( sender_obj);52 mutex_lock(&sender_phone->lock); 53 if (sender_phone->state != IPC_PHONE_CONNECTED) { 54 mutex_unlock(&sender_phone->lock); 55 kobject_put(&sender_phone->kobject); 56 56 return EINVAL; 57 57 } 58 58 59 other_task_s = sender_ obj->phone->callee->task;59 other_task_s = sender_phone->callee->task; 60 60 61 mutex_unlock(&sender_ obj->phone->lock);61 mutex_unlock(&sender_phone->lock); 62 62 63 63 /* Remember the third party task hash. */ 64 64 ipc_set_arg5(&call->data, (sysarg_t) other_task_s); 65 65 66 kobject_put( sender_obj);66 kobject_put(&sender_phone->kobject); 67 67 return EOK; 68 68 } … … 77 77 task_t *other_task_r; 78 78 79 kobject_t *recipient_obj =kobject_get(TASK,79 phone_t *recipient_phone = phone_from_kobject(kobject_get(TASK, 80 80 (cap_handle_t) ipc_get_arg1(&answer->data), 81 KOBJECT_TYPE_PHONE) ;82 if (!recipient_ obj) {81 KOBJECT_TYPE_PHONE)); 82 if (!recipient_phone) { 83 83 ipc_set_retval(&answer->data, ENOENT); 84 84 return ENOENT; 85 85 } 86 86 87 mutex_lock(&recipient_ obj->phone->lock);88 if (recipient_ obj->phone->state != IPC_PHONE_CONNECTED) {89 mutex_unlock(&recipient_ obj->phone->lock);87 mutex_lock(&recipient_phone->lock); 88 if (recipient_phone->state != IPC_PHONE_CONNECTED) { 89 mutex_unlock(&recipient_phone->lock); 90 90 ipc_set_retval(&answer->data, EINVAL); 91 kobject_put( recipient_obj);91 kobject_put(&recipient_phone->kobject); 92 92 return EINVAL; 93 93 } 94 94 95 other_task_r = recipient_ obj->phone->callee->task;95 other_task_r = recipient_phone->callee->task; 96 96 other_task_s = (task_t *) ipc_get_arg5(olddata); 97 97 … … 114 114 } 115 115 116 mutex_unlock(&recipient_ obj->phone->lock);117 kobject_put( recipient_obj);116 mutex_unlock(&recipient_phone->lock); 117 kobject_put(&recipient_phone->kobject); 118 118 } 119 119
Note:
See TracChangeset
for help on using the changeset viewer.