Changeset 82cd2e0 in mainline


Ignore:
Timestamp:
2018-10-31T06:03:38Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
faf19d4
Parents:
53ee7a0
git-author:
Jakub Jermar <jakub@…> (2018-10-28 14:28:41)
git-committer:
Jakub Jermar <jakub@…> (2018-10-31 06:03:38)
Message:

Do not leave connected phones behind

The connection structure is deallocated when client_connection returns.
We must therefore not leave any connected phones behind or else any
incoming call (e.g. IPC_M_PHONE_HUNGUP) will attempt to use the
deallocated connection structure since its address is still stored as a
label in the phone and copied to the call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/compositor/compositor.c

    r53ee7a0 r82cd2e0  
    926926                        window_t *win = window_create();
    927927                        if (!win) {
    928                                 async_answer_2(&call, ENOMEM, 0, 0);
     928                                async_answer_0(&call, EHANGUP);
    929929                                fibril_mutex_unlock(&window_list_mtx);
    930930                                return;
     
    945945                        if (loc_service_register(name_in, &win->in_dsid) != EOK) {
    946946                                window_destroy(win);
    947                                 async_answer_2(&call, EINVAL, 0, 0);
     947                                async_answer_0(&call, EHANGUP);
    948948                                fibril_mutex_unlock(&window_list_mtx);
    949949                                return;
     
    953953                                loc_service_unregister(win->in_dsid);
    954954                                window_destroy(win);
    955                                 async_answer_2(&call, EINVAL, 0, 0);
     955                                async_answer_0(&call, EHANGUP);
    956956                                fibril_mutex_unlock(&window_list_mtx);
    957957                                return;
     
    974974                        }
    975975
    976                         return;
    977                 } else {
    978                         async_answer_0(&call, EINVAL);
    979                         return;
    980                 }
     976                        async_get_call(&call);
     977                }
     978                async_answer_0(&call, EHANGUP);
     979                return;
    981980        }
    982981
Note: See TracChangeset for help on using the changeset viewer.