Changeset 91b60499 in mainline for kernel/generic/src/ipc/ops/stchngath.c
- Timestamp:
- 2017-09-30T06:29:42Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 300f4c4
- Parents:
- d076f16 (diff), 6636fb19 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/stchngath.c
rd076f16 r91b60499 43 43 static int request_preprocess(call_t *call, phone_t *phone) 44 44 { 45 phone_t *sender_phone;46 45 task_t *other_task_s; 47 46 48 if (phone_get(IPC_GET_ARG5(call->data), &sender_phone) != EOK) 47 kobject_t *sender_obj = kobject_get(TASK, IPC_GET_ARG5(call->data), 48 KOBJECT_TYPE_PHONE); 49 if (!sender_obj) 49 50 return ENOENT; 50 51 51 mutex_lock(&sender_phone->lock); 52 if (sender_phone->state != IPC_PHONE_CONNECTED) { 53 mutex_unlock(&sender_phone->lock); 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); 54 56 return EINVAL; 55 57 } 56 58 57 other_task_s = sender_ phone->callee->task;59 other_task_s = sender_obj->phone->callee->task; 58 60 59 mutex_unlock(&sender_ phone->lock);61 mutex_unlock(&sender_obj->phone->lock); 60 62 61 63 /* Remember the third party task hash. */ 62 64 IPC_SET_ARG5(call->data, (sysarg_t) other_task_s); 63 65 66 kobject_put(sender_obj); 64 67 return EOK; 65 68 } … … 71 74 if (!IPC_GET_RETVAL(answer->data)) { 72 75 /* The recipient authorized the change of state. */ 73 phone_t *recipient_phone;74 76 task_t *other_task_s; 75 77 task_t *other_task_r; 76 78 77 rc = phone_get(IPC_GET_ARG1(answer->data),78 &recipient_phone);79 if ( rc != EOK) {79 kobject_t *recipient_obj = kobject_get(TASK, 80 IPC_GET_ARG1(answer->data), KOBJECT_TYPE_PHONE); 81 if (!recipient_obj) { 80 82 IPC_SET_RETVAL(answer->data, ENOENT); 81 83 return ENOENT; 82 84 } 83 85 84 mutex_lock(&recipient_ phone->lock);85 if (recipient_ phone->state != IPC_PHONE_CONNECTED) {86 mutex_unlock(&recipient_ phone->lock);86 mutex_lock(&recipient_obj->phone->lock); 87 if (recipient_obj->phone->state != IPC_PHONE_CONNECTED) { 88 mutex_unlock(&recipient_obj->phone->lock); 87 89 IPC_SET_RETVAL(answer->data, EINVAL); 90 kobject_put(recipient_obj); 88 91 return EINVAL; 89 92 } 90 93 91 other_task_r = recipient_ phone->callee->task;94 other_task_r = recipient_obj->phone->callee->task; 92 95 other_task_s = (task_t *) IPC_GET_ARG5(*olddata); 93 96 … … 110 113 } 111 114 112 mutex_unlock(&recipient_phone->lock); 115 mutex_unlock(&recipient_obj->phone->lock); 116 kobject_put(recipient_obj); 113 117 } 114 118
Note:
See TracChangeset
for help on using the changeset viewer.