Ignore:
Timestamp:
2015-06-06T01:50:56Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0453261
Parents:
94e46c9 (diff), 87a2f9b (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.
Message:

mainline changes

File:
1 edited

Legend:

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

    r94e46c9 rb5143bd  
    4444        int newphid = phone_alloc(TASK);
    4545
     46        /* Remember the phoneid or the error. */
     47        call->priv = newphid;
    4648        if (newphid < 0)
    4749                return ELIMIT;
     
    4951        /* Set arg5 for server */
    5052        IPC_SET_ARG5(call->data, (sysarg_t) &TASK->phones[newphid]);
    51         call->priv = newphid;
    5253
    5354        return EOK;
     
    7374static int answer_process(call_t *answer)
    7475{
    75         if (IPC_GET_RETVAL(answer->data))
    76                 phone_dealloc(answer->priv);
    77         else
    78                 IPC_SET_ARG5(answer->data, answer->priv);
     76        int newphid = (int) answer->priv;
     77
     78        if (IPC_GET_RETVAL(answer->data)) {
     79                if (newphid >= 0) {
     80                        /*
     81                         * The phone was indeed allocated and now needs
     82                         * to be deallocated.
     83                         */
     84                        phone_dealloc(newphid);
     85                }
     86        } else {
     87                IPC_SET_ARG5(answer->data, newphid);
     88        }
    7989       
    8090        return EOK;
Note: See TracChangeset for help on using the changeset viewer.