Changeset 96ef672 in mainline for uspace/srv/devman/loc.c


Ignore:
Timestamp:
2016-08-05T16:13:38Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c7840e9
Parents:
f527f58
Message:

Do not leave behind functions in device_tree.loc_functions hash table

When offlining or removing a function, make sure to unregister that
function from the device tree loc_functions hash table so that the
table does not contain any deallocated links.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/loc.c

    rf527f58 r96ef672  
    6767}
    6868
     69int loc_unregister_tree_function(fun_node_t *fun, dev_tree_t *tree)
     70{
     71        int rc = loc_service_unregister(fun->service_id);
     72        tree_rem_loc_function(tree, fun);
     73        return rc;
     74}
     75
    6976fun_node_t *find_loc_tree_function(dev_tree_t *tree, service_id_t service_id)
    7077{
     
    8996}
    9097
     98void tree_rem_loc_function(dev_tree_t *tree, fun_node_t *fun)
     99{
     100        assert(fibril_rwlock_is_write_locked(&tree->rwlock));
     101       
     102        hash_table_remove(&tree->loc_functions, &fun->service_id);
     103}
     104
    91105/** @}
    92106 */
Note: See TracChangeset for help on using the changeset viewer.