Ignore:
Timestamp:
2025-01-16T21:42:15Z (20 hours ago)
Author:
GitHub <noreply@…>
Parents:
e0e2264 (diff), 455241b (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.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2025-01-16 21:42:15)
git-committer:
GitHub <noreply@…> (2025-01-16 21:42:15)
Message:

Merge 455241b37bedd3719ed3b5b025fdf26f44fd565b into e0e22648f5799cc98671695e153b0b00037daeb9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/stchngath.c

    re0e2264 r6caf5fb  
    4545        task_t *other_task_s;
    4646
    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)
    5050                return ENOENT;
    5151
    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);
    5656                return EINVAL;
    5757        }
    5858
    59         other_task_s = sender_obj->phone->callee->task;
     59        other_task_s = sender_phone->callee->task;
    6060
    61         mutex_unlock(&sender_obj->phone->lock);
     61        mutex_unlock(&sender_phone->lock);
    6262
    6363        /* Remember the third party task hash. */
    6464        ipc_set_arg5(&call->data, (sysarg_t) other_task_s);
    6565
    66         kobject_put(sender_obj);
     66        kobject_put(&sender_phone->kobject);
    6767        return EOK;
    6868}
     
    7777                task_t *other_task_r;
    7878
    79                 kobject_t *recipient_obj = kobject_get(TASK,
     79                phone_t *recipient_phone = phone_from_kobject(kobject_get(TASK,
    8080                    (cap_handle_t) ipc_get_arg1(&answer->data),
    81                     KOBJECT_TYPE_PHONE);
    82                 if (!recipient_obj) {
     81                    KOBJECT_TYPE_PHONE));
     82                if (!recipient_phone) {
    8383                        ipc_set_retval(&answer->data, ENOENT);
    8484                        return ENOENT;
    8585                }
    8686
    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);
    9090                        ipc_set_retval(&answer->data, EINVAL);
    91                         kobject_put(recipient_obj);
     91                        kobject_put(&recipient_phone->kobject);
    9292                        return EINVAL;
    9393                }
    9494
    95                 other_task_r = recipient_obj->phone->callee->task;
     95                other_task_r = recipient_phone->callee->task;
    9696                other_task_s = (task_t *) ipc_get_arg5(olddata);
    9797
     
    114114                }
    115115
    116                 mutex_unlock(&recipient_obj->phone->lock);
    117                 kobject_put(recipient_obj);
     116                mutex_unlock(&recipient_phone->lock);
     117                kobject_put(&recipient_phone->kobject);
    118118        }
    119119
Note: See TracChangeset for help on using the changeset viewer.