Changeset de1074b in mainline


Ignore:
Timestamp:
2018-03-13T18:01:47Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6c87f3a
Parents:
bde48fa
git-author:
Jakub Jermar <jakub@…> (2018-03-04 17:51:52)
git-committer:
Jakub Jermar <jakub@…> (2018-03-13 18:01:47)
Message:

Handle race condition in phone_connect

Do not panic if the phone is not in the expected state. This could mean
that the user hung up the original phone and created a new one under the
same capability handle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipcrsc.c

    rbde48fa rde1074b  
    219219                return false;
    220220
    221         assert(phone_obj->phone->state == IPC_PHONE_CONNECTING);
     221        if (phone_obj->phone->state != IPC_PHONE_CONNECTING) {
     222                /*
     223                 * This looks like another phone. The one we were expecting
     224                 * under this handle must be in the IPC_PHONE_CONNECTING state.
     225                 */
     226                kobject_put(phone_obj);
     227                return false;
     228        }
    222229
    223230        /* Hand over phone_obj reference to the answerbox */
Note: See TracChangeset for help on using the changeset viewer.