usb_modeswitch: apply changes suggested by korli
Didn't notice them in the ticket comments.
This commit is contained in:
parent
7118f1582e
commit
86e8c37605
@ -531,14 +531,13 @@ my_device_added(usb_device newDevice, void **cookie)
|
||||
|
||||
mutex_init(&device->lock, DRIVER_NAME " device lock");
|
||||
|
||||
sem_id id = create_sem(0, DRIVER_NAME " callback notify");
|
||||
if (id < B_OK) {
|
||||
sem_id callbackSem = create_sem(0, DRIVER_NAME " callback notify");
|
||||
if (callbackSem < B_OK) {
|
||||
mutex_destroy(&device->lock);
|
||||
free(device);
|
||||
return id;
|
||||
} else {
|
||||
device->notify = id;
|
||||
return callbackSem;
|
||||
}
|
||||
device->notify = callbackSem;
|
||||
|
||||
mutex_lock(&gDeviceListLock);
|
||||
device->link = gDeviceList;
|
||||
|
Loading…
Reference in New Issue
Block a user