Changeset dbf5d7c in mainline for uspace/srv/hid/display/main.c


Ignore:
Timestamp:
2020-06-22T17:32:27Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2fc1e6d
Parents:
56dcf53
git-author:
Jiri Svoboda <jiri@…> (2020-06-22 17:31:21)
git-committer:
Jiri Svoboda <jiri@…> (2020-06-22 17:32:27)
Message:

Only initialize input after we have probed for display devices

Avoids null pointer dereference (null GC) that could occur if an input event
arrived earlier than we could initialize a display device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/main.c

    r56dcf53 rdbf5d7c  
    102102                goto error;
    103103
    104         rc = ds_input_open(disp);
    105         if (rc != EOK)
    106                 goto error;
    107 
    108104        rc = ds_output_create(&output);
    109105        if (rc != EOK)
     
    112108        output->def_display = disp;
    113109        rc = ds_output_start_discovery(output);
     110        if (rc != EOK)
     111                goto error;
     112
     113        rc = ds_input_open(disp);
    114114        if (rc != EOK)
    115115                goto error;
Note: See TracChangeset for help on using the changeset viewer.