Changeset df54aa8 in mainline


Ignore:
Timestamp:
2023-01-03T20:06:16Z (17 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cdd6fc9
Parents:
570a3f3
git-author:
Jiri Svoboda <jiri@…> (2023-01-03 17:56:24)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-03 20:06:16)
Message:

Fix replies in wndmgt_srv error paths

Under the right circumstances we would get an assertion failure,
but in most cases async_answer() would silently fail without
anyone noticing. Since the handle would essentialy be garbage,
we could hit another handle by accident.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/wndmgt/src/wndmgt_srv.c

    r570a3f3 rdf54aa8  
    7272        rc = srv->ops->get_window_list(srv->arg, &list);
    7373        if (rc != EOK) {
    74                 async_answer_0(&call, rc);
    7574                async_answer_0(icall, rc);
    7675                return;
     
    8180        if (!async_data_read_receive(&call, &size)) {
    8281                wndmgt_free_window_list(list);
     82                async_answer_0(&call, EREFUSED);
    8383                async_answer_0(icall, EREFUSED);
    8484                return;
     
    104104        if (!async_data_read_receive(&call, &size)) {
    105105                wndmgt_free_window_list(list);
     106                async_answer_0(&call, EREFUSED);
    106107                async_answer_0(icall, EREFUSED);
    107108                return;
     
    145146        rc = srv->ops->get_window_info(srv->arg, wnd_id, &info);
    146147        if (rc != EOK) {
    147                 async_answer_0(&call, rc);
    148148                async_answer_0(icall, rc);
    149149                return;
     
    154154        if (!async_data_read_receive(&call, &size)) {
    155155                wndmgt_free_window_info(info);
     156                async_answer_0(&call, EREFUSED);
    156157                async_answer_0(icall, EREFUSED);
    157158                return;
     
    179180        if (!async_data_read_receive(&call, &size)) {
    180181                wndmgt_free_window_info(info);
     182                async_answer_0(&call, EREFUSED);
    181183                async_answer_0(icall, EREFUSED);
    182184                return;
     
    256258        /* Transfer event data */
    257259        if (!async_data_read_receive(&call, &size)) {
     260                async_answer_0(&call, EREFUSED);
    258261                async_answer_0(icall, EREFUSED);
    259262                return;
     
    261264
    262265        if (size != sizeof(event)) {
    263                 async_answer_0(icall, EREFUSED);
    264                 async_answer_0(&call, EREFUSED);
     266                async_answer_0(&call, EREFUSED);
     267                async_answer_0(icall, EREFUSED);
    265268                return;
    266269        }
     
    268271        rc = async_data_read_finalize(&call, &event, sizeof(event));
    269272        if (rc != EOK) {
    270                 async_answer_0(icall, rc);
    271                 async_answer_0(&call, rc);
     273                async_answer_0(&call, rc);
     274                async_answer_0(icall, rc);
    272275                return;
    273276        }
Note: See TracChangeset for help on using the changeset viewer.