* Don't leak the decoded instructions in case the device object cannot be
allocated. * Remove accidentally added debug device id. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27461 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8008c36e34
commit
b57520d4a9
@ -181,20 +181,21 @@ HIDDevice::MakeHIDDevice(usb_device device,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// determine device type and create the device object
|
// determine device type and create the device object
|
||||||
|
HIDDevice *hidDevice = NULL;
|
||||||
if (deviceType == USB_HID_DEVICE_TYPE_KEYBOARD) {
|
if (deviceType == USB_HID_DEVICE_TYPE_KEYBOARD) {
|
||||||
return new(std::nothrow) KeyboardDevice(device, interruptPipe,
|
hidDevice = new(std::nothrow) KeyboardDevice(device, interruptPipe,
|
||||||
interfaceIndex, finalInstructions, instructionCount,
|
interfaceIndex, finalInstructions, instructionCount,
|
||||||
totalReportSize);
|
totalReportSize);
|
||||||
} else if (deviceType == USB_HID_DEVICE_TYPE_MOUSE
|
} else if (deviceType == USB_HID_DEVICE_TYPE_MOUSE) {
|
||||||
|| deviceType == 0x01250015) {
|
hidDevice = new(std::nothrow) MouseDevice(device, interruptPipe,
|
||||||
return new(std::nothrow) MouseDevice(device, interruptPipe,
|
|
||||||
interfaceIndex, finalInstructions, instructionCount,
|
interfaceIndex, finalInstructions, instructionCount,
|
||||||
totalReportSize);
|
totalReportSize);
|
||||||
}
|
} else
|
||||||
|
TRACE_ALWAYS("unsupported device type 0x%08lx\n", deviceType);
|
||||||
|
|
||||||
TRACE_ALWAYS("unsupported device type 0x%08lx\n", deviceType);
|
if (hidDevice == NULL)
|
||||||
free(finalInstructions);
|
free(finalInstructions);
|
||||||
return NULL;
|
return hidDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user