summaryrefslogtreecommitdiffstats
path: root/src/drivers/usb/usbio.c
diff options
context:
space:
mode:
authorMichael Brown2015-09-11 00:22:43 +0200
committerMichael Brown2015-09-13 13:54:31 +0200
commit7107334391d05bd60a44daaee732c19860ca87bc (patch)
tree143821c45a4d75e3ca6808321200704abbabbbc2 /src/drivers/usb/usbio.c
parent[xhci] Support arbitrarily large transfers (diff)
downloadipxe-7107334391d05bd60a44daaee732c19860ca87bc.tar.gz
ipxe-7107334391d05bd60a44daaee732c19860ca87bc.tar.xz
ipxe-7107334391d05bd60a44daaee732c19860ca87bc.zip
[efi] Provide efi_devpath_len()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/usb/usbio.c')
-rw-r--r--src/drivers/usb/usbio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/drivers/usb/usbio.c b/src/drivers/usb/usbio.c
index a80f7c8f..2c15200c 100644
--- a/src/drivers/usb/usbio.c
+++ b/src/drivers/usb/usbio.c
@@ -1492,15 +1492,14 @@ static int usbio_path ( struct usbio_device *usbio ) {
path = u.interface;
/* Locate end of device path and sanity check */
- end = efi_devpath_end ( path );
- len = ( ( ( void * ) end ) - ( ( void * ) path ) );
+ len = efi_devpath_len ( path );
if ( len < sizeof ( *usbpath ) ) {
DBGC ( usbio, "USBIO %s underlength device path\n",
efi_handle_name ( handle ) );
rc = -EINVAL;
goto err_underlength;
}
- usbpath = ( ( ( void * ) end ) - sizeof ( *usbpath ) );
+ usbpath = ( ( ( void * ) path ) + len - sizeof ( *usbpath ) );
if ( ! ( ( usbpath->Header.Type == MESSAGING_DEVICE_PATH ) &&
( usbpath->Header.SubType == MSG_USB_DP ) ) ) {
DBGC ( usbio, "USBIO %s not a USB device path: ",