Changes in kernel/generic/src/ipc/ops/stchngath.c [48bcf49:b1e6269] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ops/stchngath.c
r48bcf49 rb1e6269 43 43 static int request_preprocess(call_t *call, phone_t *phone) 44 44 { 45 phone_t *sender_phone; 45 46 task_t *other_task_s; 46 47 47 kobject_t *sender_obj = kobject_get(TASK, IPC_GET_ARG5(call->data), 48 KOBJECT_TYPE_PHONE); 49 if (!sender_obj) 48 if (phone_get(IPC_GET_ARG5(call->data), &sender_phone) != EOK) 50 49 return ENOENT; 51 50 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); 51 mutex_lock(&sender_phone->lock); 52 if (sender_phone->state != IPC_PHONE_CONNECTED) { 53 mutex_unlock(&sender_phone->lock); 56 54 return EINVAL; 57 55 } 58 56 59 other_task_s = sender_ obj->phone->callee->task;57 other_task_s = sender_phone->callee->task; 60 58 61 mutex_unlock(&sender_ obj->phone->lock);59 mutex_unlock(&sender_phone->lock); 62 60 63 61 /* Remember the third party task hash. */ 64 62 IPC_SET_ARG5(call->data, (sysarg_t) other_task_s); 65 63 66 kobject_put(sender_obj);67 64 return EOK; 68 65 } … … 74 71 if (!IPC_GET_RETVAL(answer->data)) { 75 72 /* The recipient authorized the change of state. */ 73 phone_t *recipient_phone; 76 74 task_t *other_task_s; 77 75 task_t *other_task_r; 78 76 79 kobject_t *recipient_obj = kobject_get(TASK,80 IPC_GET_ARG1(answer->data), KOBJECT_TYPE_PHONE);81 if ( !recipient_obj) {77 rc = phone_get(IPC_GET_ARG1(answer->data), 78 &recipient_phone); 79 if (rc != EOK) { 82 80 IPC_SET_RETVAL(answer->data, ENOENT); 83 81 return ENOENT; 84 82 } 85 83 86 mutex_lock(&recipient_ obj->phone->lock);87 if (recipient_ obj->phone->state != IPC_PHONE_CONNECTED) {88 mutex_unlock(&recipient_ obj->phone->lock);84 mutex_lock(&recipient_phone->lock); 85 if (recipient_phone->state != IPC_PHONE_CONNECTED) { 86 mutex_unlock(&recipient_phone->lock); 89 87 IPC_SET_RETVAL(answer->data, EINVAL); 90 kobject_put(recipient_obj);91 88 return EINVAL; 92 89 } 93 90 94 other_task_r = recipient_ obj->phone->callee->task;91 other_task_r = recipient_phone->callee->task; 95 92 other_task_s = (task_t *) IPC_GET_ARG5(*olddata); 96 93 … … 113 110 } 114 111 115 mutex_unlock(&recipient_obj->phone->lock); 116 kobject_put(recipient_obj); 112 mutex_unlock(&recipient_phone->lock); 117 113 } 118 114
Note:
See TracChangeset
for help on using the changeset viewer.