Changeset 3fb5a3e in mainline for uspace/drv/usbhub/ports.c


Ignore:
Timestamp:
2011-05-28T14:34:43Z (15 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/ports.c

    r400735e r3fb5a3e  
    407407        free(arg);
    408408
     409        fibril_mutex_lock(&data->hub->pending_ops_mutex);
     410        assert(data->hub->pending_ops_count > 0);
     411        data->hub->pending_ops_count--;
     412        fibril_condvar_signal(&data->hub->pending_ops_cv);
     413        fibril_mutex_unlock(&data->hub->pending_ops_mutex);
     414
     415
    409416        return EOK;
    410417}
     
    452459                return ENOMEM;
    453460        }
     461        fibril_mutex_lock(&hub->pending_ops_mutex);
     462        hub->pending_ops_count++;
     463        fibril_mutex_unlock(&hub->pending_ops_mutex);
    454464        fibril_add_ready(fibril);
    455465
Note: See TracChangeset for help on using the changeset viewer.