Changeset eab9689 in mainline


Ignore:
Timestamp:
2015-06-03T15:36:08Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
022d72ff
Parents:
53031c2
Message:

Fix assertion on phone→state == IPC_PHONE_CONNECTING in phone_dealloc()

When handling IPC_M_CONNECT_ME_TO, remember the return value from
phone_alloc() in order to be later able to tell whether a phone was
indeed allocated or not.

File:
1 edited

Legend:

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

    r53031c2 reab9689  
    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        if (IPC_GET_RETVAL(answer->data) && ((int) answer->priv >= 0)) {
     77                /*
     78                 * Something went wrong and there is a phone that needs to be
     79                 * deallocated.
     80                 */
    7681                phone_dealloc(answer->priv);
    77         else
     82        } else {
    7883                IPC_SET_ARG5(answer->data, answer->priv);
     84        }
    7985       
    8086        return EOK;
Note: See TracChangeset for help on using the changeset viewer.