Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0800b26 in mainline


Ignore:
Timestamp:
2020-05-06T10:30:30Z (3 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
7a34f87d, 807be7e
Parents:
ccbd2e1
Message:

Do not leak exchanges in udebug client API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/udebug.c

    rccbd2e1 r0800b26  
    4242{
    4343        async_exch_t *exch = async_exchange_begin(sess);
    44         return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_BEGIN);
     44        errno_t rc = async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_BEGIN);
     45        async_exchange_end(exch);
     46
     47        return rc;
    4548}
    4649
     
    4851{
    4952        async_exch_t *exch = async_exchange_begin(sess);
    50         return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_END);
     53        errno_t rc = async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_END);
     54        async_exchange_end(exch);
     55
     56        return rc;
    5157}
    5258
     
    5460{
    5561        async_exch_t *exch = async_exchange_begin(sess);
    56         return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_SET_EVMASK, mask);
     62        errno_t rc = async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_SET_EVMASK, mask);
     63        async_exchange_end(exch);
     64
     65        return rc;
    5766}
    5867
     
    6574        errno_t rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_THREAD_READ,
    6675            (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
     76        async_exchange_end(exch);
    6777
    6878        *copied = (size_t) a_copied;
     
    8090        errno_t rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_NAME_READ,
    8191            (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
     92        async_exchange_end(exch);
    8293
    8394        *copied = (size_t) a_copied;
     
    95106        errno_t rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_AREAS_READ,
    96107            (sysarg_t) buffer, n, NULL, &a_copied, &a_needed);
     108        async_exchange_end(exch);
    97109
    98110        *copied = (size_t) a_copied;
     
    105117{
    106118        async_exch_t *exch = async_exchange_begin(sess);
    107         return async_req_4_0(exch, IPC_M_DEBUG, UDEBUG_M_MEM_READ,
     119        errno_t rc = async_req_4_0(exch, IPC_M_DEBUG, UDEBUG_M_MEM_READ,
    108120            (sysarg_t) buffer, addr, n);
     121        async_exchange_end(exch);
     122
     123        return rc;
    109124}
    110125
     
    112127{
    113128        async_exch_t *exch = async_exchange_begin(sess);
    114         return async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_ARGS_READ,
     129        errno_t rc = async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_ARGS_READ,
    115130            tid, (sysarg_t) buffer);
     131        async_exchange_end(exch);
     132
     133        return rc;
    116134}
    117135
     
    119137{
    120138        async_exch_t *exch = async_exchange_begin(sess);
    121         return async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_REGS_READ,
     139        errno_t rc = async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_REGS_READ,
    122140            tid, (sysarg_t) buffer);
     141        async_exchange_end(exch);
     142
     143        return rc;
    123144}
    124145
     
    131152        errno_t rc = async_req_2_3(exch, IPC_M_DEBUG, UDEBUG_M_GO,
    132153            tid, &a_ev_type, val0, val1);
     154        async_exchange_end(exch);
    133155
    134156        *ev_type = a_ev_type;
     
    139161{
    140162        async_exch_t *exch = async_exchange_begin(sess);
    141         return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_STOP, tid);
     163        errno_t rc = async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_STOP, tid);
     164        async_exchange_end(exch);
     165
     166        return rc;
    142167}
    143168
Note: See TracChangeset for help on using the changeset viewer.