Changeset 702729e in mainline for uspace/lib/drv/generic/driver.c


Ignore:
Timestamp:
2018-01-29T01:32:22Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
18092dd3
Parents:
203b80c
Message:

libdrv: when the device is freed, it must be also removed from the list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/driver.c

    r203b80c r702729e  
    196196                rc = ENOTSUP;
    197197       
    198         if (rc == EOK)
     198        if (rc == EOK) {
     199                fibril_mutex_lock(&devices_mutex);
     200                list_remove(&dev->link);
     201                fibril_mutex_unlock(&devices_mutex);
    199202                dev_del_ref(dev);
     203        }
    200204       
    201205        dev_del_ref(dev);
     
    225229                rc = ENOTSUP;
    226230       
    227         if (rc == EOK)
     231        if (rc == EOK) {
     232                fibril_mutex_lock(&devices_mutex);
     233                list_remove(&dev->link);
     234                fibril_mutex_unlock(&devices_mutex);
    228235                dev_del_ref(dev);
     236        }
    229237       
    230238        dev_del_ref(dev);
Note: See TracChangeset for help on using the changeset viewer.