mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 10:52:15 +02:00
Usb: Fix freeInterface(NULL);
This commit is contained in:
parent
7871ecbc33
commit
ac9851b5a3
@ -542,7 +542,6 @@ Result usbDsGetDsInterface(UsbDsInterface** interface, struct usb_interface_desc
|
|||||||
UsbDsInterface* ptr = _usbDsTryAllocateInterface(send_desc.bInterfaceNumber);
|
UsbDsInterface* ptr = _usbDsTryAllocateInterface(send_desc.bInterfaceNumber);
|
||||||
if(ptr == NULL) {
|
if(ptr == NULL) {
|
||||||
serviceClose(&srv);
|
serviceClose(&srv);
|
||||||
_usbDsFreeInterface(ptr);
|
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
return MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,7 +614,6 @@ Result usbDsRegisterInterface(UsbDsInterface** interface)
|
|||||||
UsbDsInterface* ptr = _usbDsTryAllocateInterface(intf_num);
|
UsbDsInterface* ptr = _usbDsTryAllocateInterface(intf_num);
|
||||||
if(ptr == NULL) {
|
if(ptr == NULL) {
|
||||||
serviceClose(&srv);
|
serviceClose(&srv);
|
||||||
_usbDsFreeInterface(ptr);
|
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
return MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -698,7 +696,6 @@ Result usbDsRegisterInterfaceEx(UsbDsInterface** interface, u32 intf_num)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Result usbDsClearDeviceData(void) {
|
Result usbDsClearDeviceData(void) {
|
||||||
return _usbDsCmdNoParams(&g_usbDsSrv, 5);
|
return _usbDsCmdNoParams(&g_usbDsSrv, 5);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user