Changeset a0d4afe in mainline for uspace/srv/hid/display/display.c


Ignore:
Timestamp:
2023-01-18T16:51:44Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3e7e226
Parents:
b0ae23f
Message:

Make sure input device configuration is destroyed together with seat

When a seat is destroyed without unassigning devices first, this causes
a dangling seat pointer that would cause the display server to crash
if the corresponding device generates an event.

File:
1 edited

Legend:

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

    rb0ae23f ra0d4afe  
    796796{
    797797        assert(idevcfg->display == NULL);
    798         assert(!link_used(&idevcfg->lidevcfgs));
     798        assert(!link_used(&idevcfg->ldispidcfgs));
    799799
    800800        idevcfg->display = disp;
    801         list_append(&idevcfg->lidevcfgs, &disp->idevcfgs);
     801        list_append(&idevcfg->ldispidcfgs, &disp->idevcfgs);
    802802}
    803803
     
    808808void ds_display_remove_idevcfg(ds_idevcfg_t *idevcfg)
    809809{
    810         list_remove(&idevcfg->lidevcfgs);
     810        list_remove(&idevcfg->ldispidcfgs);
    811811        idevcfg->display = NULL;
    812812}
     
    824824                return NULL;
    825825
    826         return list_get_instance(link, ds_idevcfg_t, lidevcfgs);
     826        return list_get_instance(link, ds_idevcfg_t, ldispidcfgs);
    827827}
    828828
     
    834834ds_idevcfg_t *ds_display_next_idevcfg(ds_idevcfg_t *idevcfg)
    835835{
    836         link_t *link = list_next(&idevcfg->lidevcfgs, &idevcfg->display->idevcfgs);
    837 
    838         if (link == NULL)
    839                 return NULL;
    840 
    841         return list_get_instance(link, ds_idevcfg_t, lidevcfgs);
     836        link_t *link = list_next(&idevcfg->ldispidcfgs, &idevcfg->display->idevcfgs);
     837
     838        if (link == NULL)
     839                return NULL;
     840
     841        return list_get_instance(link, ds_idevcfg_t, ldispidcfgs);
    842842}
    843843
Note: See TracChangeset for help on using the changeset viewer.