Changeset 3fb5a3e in mainline for uspace/drv/usbhub/usbhub.h


Ignore:
Timestamp:
2011-05-28T14:34:43Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af6136d
Parents:
400735e
Message:

Do not delete hub info too early

When a hub is disconnected during port change (device adding) the
structure was deleted and accessed *later* from the device adding
routine. Because allocator is next fit, the error went unnoticed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/usbhub.h

    r400735e r3fb5a3e  
    8989        /** generic usb device data*/
    9090        usb_device_t * usb_device;
     91
     92        /** Number of pending operations on the mutex to prevent shooting
     93         * ourselves in the foot.
     94         * When the hub is disconnected but we are in the middle of some
     95         * operation, we cannot destroy this structure right away because
     96         * the pending operation might use it.
     97         */
     98        size_t pending_ops_count;
     99        /** Guard for pending_ops_count. */
     100        fibril_mutex_t pending_ops_mutex;
     101        /** Condition variable for pending_ops_count. */
     102        fibril_condvar_t pending_ops_cv;
     103
    91104};
    92105
Note: See TracChangeset for help on using the changeset viewer.