Changeset 8a5de14 in mainline


Ignore:
Timestamp:
2018-03-11T07:35:05Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Children:
35fd816
Parents:
fb1f664
git-author:
Jakub Jermar <jakub@…> (2018-03-04 17:51:52)
git-committer:
Jakub Jermar <jakub@…> (2018-03-11 07:35:05)
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

    rfb1f664 r8a5de14  
    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.