aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/usb/usbio.c
diff options
context:
space:
mode:
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 a80f7c8..2c15200 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: ",